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

Synchronized Combo boxes again 1

Status
Not open for further replies.

rowan1

Technical User
Mar 26, 2002
24
ES
I have a form order details with three combo boxes; cbocategoryselect, cboproductselect and cboitemselect. I want to synchronize these so that product is dependant on the choice of category and item is dependant on the choice of product. The code I have is

Private Sub cbocategoryselect_AfterUpdate()
Me.cboproductselect.Requery
Me.cboproductselect.SetFocus
End Sub

Private Sub cboProductSelect_AfterUpdate()
Me.cboItemselect.Requery
Me.cboItemselect.SetFocus
End Sub

This seems to work standing alone but when I try to put it as a sub form inside an order form. I keep getting asked for the parameter value of each combo box. Can anyone help please?
 
I have gotten this error before and I have found that it happens when I close the form. The fix that I stumbled upon was instead of closing the form run a macro that minimizes the form first and then closes it. Somehow this prevents the qry's from running and the form closes smoothly. I hope this helps.
 
You have to specify/reference the forms in order to do this, that is why you're getting error messages

So if you had a Mainform and a subform where a combobox is on the main and two comboboxes on the subform, you would need to have something like this to reference the subform combo boxes:

Forms!Mainform!Subform!Combo1.value

Put this in the criteria for your query that supplies the rowsource for a combobox in your subform
(Change name of Mainform and SubForm to your forms' names obviously)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top