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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a combo box in a subform from a field in the parent form?

Status
Not open for further replies.

Sarah28

IS-IT--Management
Aug 6, 2000
16
0
0
US
Visit site
I have a field called "Model" in my parent form.  Based on the "Model" the user chooses I would like to populate the "Options" field in my subform.  When the user chooses an "Option" from the subform, I would like the "Unit Price" for the "Option" to display in the "Unit Price" field.  How do I do this?
 
In the Model &quot;After update&quot; event you need VBA code.<br>Since you did not say where the &quot;Options&quot; data is coming from. I have to guess.<br><br>If its from a table then you can create a combox box using the Wizard and then edit the SQL code it generates to look at the &quot;Model&quot; field and have a .Requery in the &quot;After Update&quot; event.<br><br>SELECT DISTINCTROW Options, FROM YourTable WHERE (((Model)=[Forms]![Your form]![Model]));<br>I don't know if I have the correct fields in the above SQL.<br><br>Private Sub Model_AfterUpdate()<br>&nbsp;&nbsp;&nbsp;&nbsp;YourCombo.Requery<br>End Sub<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top