passing two control values

Johnny Drama

In need of beer...
Local time
Today, 07:00
Joined
Dec 12, 2008
Messages
211
Hello all,

I have a form and when I double click on a field (documentID) it opens a second form which filters for the documentID.

DoCmd.OpenForm "frmPBCdetail", acNormal, , "[documentid] = " & Me.[DocumentID]

I was wondering if it is possible to pass a second control value at the same time that will also be filtered as well.

Thanks
 
Hello all,

I have a form and when I double click on a field (documentID) it opens a second form which filters for the documentID.

DoCmd.OpenForm "frmPBCdetail", acNormal, , "[documentid] = " & Me.[DocumentID]

I was wondering if it is possible to pass a second control value at the same time that will also be filtered as well.

Thanks

Yes, you can filter by multi criteria.

Try something like:

Code:
DoCmd.OpenForm "frmPBCdetail", acNormal, , "[documentid] = " & Me.[DocumentID] & " and [MyOtherField] = " & Me.MyOtherControl
Note the above assumes the additional criteria is of a numeric data type.

if the second criteria is a string then try:

Code:
DoCmd.OpenForm "frmPBCdetail", acNormal, , "[documentid] = " & Me.[DocumentID]  & " and [MyOtherField] = """ & Me.MyOtherControl & """"
 
Worked like a charm. Thanks much!
 

Users who are viewing this thread

Back
Top Bottom