stLinkCriteria

  • Thread starter Thread starter Melissa
  • Start date Start date
M

Melissa

Hey all!

I wish to open a form from a form where two fields are
the same, e.g. invoice number, work category.

Linking by one field I know how to do. But I need more
selection. How do I adjust the following code to test for
two fields? (inum and wcat) ?

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmWrkSum"
stLinkCriteria = "[inum]=" & Me![inum]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanking you in advance...
Melissa
 
It's a WHERE clause without the WHERE. So just and the 2 expressions.
stLinkCriteria = "inum=" & Me.inum & " AND wcat=" & Me.wcat

If wcat is a string then wrap the value in single quotes...
stLinkCriteria = "inum=" & Me.inum & " AND wcat='" & Me.wcat & "'"

- Jim
 
Thankyou soooooooooo much, Jim. That solved current
dilemma and taught me something new.

Thanks, Melissa

-----Original Message-----
It's a WHERE clause without the WHERE. So just and the 2 expressions.
stLinkCriteria = "inum=" & Me.inum & " AND wcat=" & Me.wcat

If wcat is a string then wrap the value in single quotes...
stLinkCriteria = "inum=" & Me.inum & " AND wcat='" & Me.wcat & "'"

- Jim

Hey all!

I wish to open a form from a form where two fields are
the same, e.g. invoice number, work category.

Linking by one field I know how to do. But I need more
selection. How do I adjust the following code to test for
two fields? (inum and wcat) ?

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmWrkSum"
stLinkCriteria = "[inum]=" & Me![inum]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanking you in advance...
Melissa

.
 
Back
Top