Repaint, Requery or What?

  • Thread starter Thread starter Ivor Williams
  • Start date Start date
I

Ivor Williams

I have a form with a subform. Based on information in the main form, a Make
Table Query is run which makes a table to use as the data source for the
subform. I want to set it up so that after a specific field in the main form
is updated, the query runs, making the table, and then the subform is
populated using the data in the table which the Make Table Query just
created. Can someone let me know which hoops to jump throught to accomplish
this?

Ivor
 
Ivor,

There are a number of ways to approach the running of the MakeTable. If
you have this already set up as a saved query in your database, then you
could use code similar to this, on the AfterUpdate event of the control
on the form...

DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False
DoCmd.OpenQuery "NameOfYourMakeTableQuery"
DoCmd.SetWarnings True
Me.NameOfSubform.Form.RecordSource = "NameOfTable"
 
Steve...

As always, your advice is exactly what was needed and very easy to
understand. Much appreciated.

Ivor
 
Back
Top