Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Two where conditions to open a form

$
0
0
I am trying to open a form using two where conditions. I can get stLinkCriteria1 and stLinkCriteria2 to work seperately (the code commented out) but not together. What am I doing wrong?

Private Sub Command55_Click()

Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String

stDocName = "frmEdit_All_Billing_Data1"

stLinkCriteria = "FYPeriod=" & "'" & [frmALL_Project_Billing Data].Form.[txt_Project_Data_FY_Period] & "'" And "User=" & "'" & Environ("USERNAME") & "'"
'stLinkCriteria1 = "FYPeriod=" & "'" & [frmALL_Project_Billing Data].Form.[txt_Project_Data_FY_Period] & "'"
'stLinkCriteria2 = "User=" & "'" & Environ("USERNAME") & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub

Viewing all articles
Browse latest Browse all 13329

Trending Articles