View Full Version : How to create a criteria


LEEWEI
06-01-2000, 12:23 AM
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!

Neal
06-01-2000, 07:47 AM
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