Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Subform Refresh

Status
Not open for further replies.

mbthaz

Technical User
Aug 29, 2002
44
US
I have a form CUID_Lookup and a subform Employee/Manager. I have the child parent relationships set to the common field in each "CUID" How do I get the subform to a) start empty until something is chosen from the CUID combo box in the main form, and b) update when a selection is made in the main form. I've seen many of these form/subform questions but no answers that fix my problem.

Thanks in advance,

Mike
 
First of all to get the subform to start out blank just leave the Source Object property of of the Main Forms SubForm control blank. This will display a blank empty screen in the subform.

In the after update event procedure of the CUID ComboBox put the following VBA code:

Forms![MainForm]![SubFormControl].SourceObject = "frmSubFormName"
Forms![MainForm]![SubFormControl].Requery


The subform control will now have a form which has a Record Source set to a query that uses the MainForm ComboBox as criteria for selecting the records.

I hope this works in your situation. Bob Scriver
 
That was exactly what I needed. I couldn't figure out how to get a handle to the subform and requery it. Thanks much ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top