Repaint, Requery or What?

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
 
S

Steve Schapel

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"
 
I

Ivor Williams

Steve...

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

Ivor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top