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!

Como box help

Status
Not open for further replies.

jeff1

IS-IT--Management
Nov 8, 2000
49
US
I need to have a combo box that will display a list that is based on what the user selects in a previous field on the form. I have the list in a table. For example if the user selects an R in the previous field, the next combo box will be accupied with only records that the RV_class in the table that contains the records that I want to display is = to the field on the form.


SELECT RV_Codes.RV_ID, RV_Codes.RV_Code, RV_Codes.Class
FROM RV_Codes
WHERE (((RV_Codes.Class)=[Forms]![DataEntry]![Equip or Reag?]));


This should be easy but the solution is really avoiding me.

Thanks in advance for your help.
 
Use the control's AfterUpdate event to update the combo's list.

me.cbo.RowSource = "SELECT RV_Codes.RV_ID, RV_Codes.RV_Code, RV_Codes.Class
FROM RV_Codes
WHERE (((RV_Codes.Class)='" & [Forms]![DataEntry]![Equip or Reag?] & "'));"

Make sure the reference to the form control remains outside the string quotes.
 
Thanks to everyone. I was missing the code to ReQuery after updating the first Combo box. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top