How to create a criteria

  • Thread starter Thread starter LEEWEI
  • Start date Start date
L

LEEWEI

Guest
Hi,
I've 2 combo box and a button in a form, how do I specify a selection criteria that when the user select from combo box 1 then combo box 2 and open up the form.

I can do it with a single combo box :

Dim stdocname As String
Dim stLinkCriteria As String

stdocname = "Project Request Approval"
DoCmd.OpenForm stdocname
DoCmd.ApplyFilter , "Dept = Forms![Project Request Approval by Selection]!combo22"
DoCmd.GoToRecord , , acLast

Please help!
 
I think this would work:


Dim stdocname As String
Dim stLinkCriteria As String

stdocname = "Project Request Approval"
stLinkCriteria = "Dept = Forms![Project Request Approval by Selection]!combo22 and Other = Forms![Project Request Approval by Selection!OtherCombo"



DoCmd.OpenForm stdocname,,, stLinkCriteria
 

Users who are viewing this thread

Back
Top Bottom