Another method of finding out the exact syntax to use is to create a new query and add those fields with criteria, then copy the syntax from the SQL of the query. Access will know when to use quotes and when not to.
Another method of finding out the exact syntax to use is to create a new query and add those fields with criteria, then copy the syntax from the SQL of the query. Access will know when to use quotes and when not to.
Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "'"
I put in this code and it does not prompt for Parameter value but it is also not filtering.
I filters fine when I go back to the Chr34 code.
Any idea why!
No idea! I never use Chr34 and haven't seen it used either. Does it work on the TO field? Are you sure you have the correct quotes? It was incorrect in post #12.
UPDATE:
This code is now working and both comboboxes are filtering correctly. The only problem left is that the first time through I can select a ContractNum and the corresponding Task Order(TO)s come up in the cboTO. When I select a different ContractNum the values are not changing in the cboTo field. I am using a Requery in the code so I am not sure what else to do.
Private Sub cboContractNum_AfterUpdate()
Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "'"
Me.FilterOn = True
Me.Requery
End Sub
Private Sub cboTO_AfterUpdate()
Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "' And [TO] = '" & Me.cboTO & "'"
Me.FilterOn = True
Me.Requery
End Sub
Requery the combobox instead of the form - Me.cboTO.Requery
Thanks!!! Works like a charm!!!