How can I limit the contents of a Combo Box where one of the ComboBox
fields
is equal to the OpenArgs of the form?
Thanks in advance!
K
Let's assume you are sending a [City] OpenArgts value to a form and
your combo box is to show only customers in that city.
Leave the Combo Box Rowsource blank.
Code the Form's Load event:
If Not IsNull(Me.OpenArgs) Then
Me![ComboName].Rowsource = "Select YourTable.CustName From YourTable
Where YourTable.City = """ & Me.OpenArgs & """"
Else
Me![ComboName].Rowsource = "Select YourTable.CustName, YourTable.City
From YourTable;"
End If
You'll show only customers from the City passed in the OpenArgs, or
both Customers and City if no OpenArgs has been passed.