VB Coding

slyvsspy

Registered User.
Local time
Today, 03:03
Joined
Jun 24, 2002
Messages
51
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "multipleselectquery"
stLinkCriteria = "[LastName] = 'Reynolds'"

DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub


Can anyone tell me how to get the "stLinkCriteria" string to take effect when I open the query. Thanks for your help. Josh
 
Thanks Alexandre

But it pops up saying "Wrong number of arguments or invalid property assignment.

Should I put
DoCmd.ApplyFilter stDocName, , stLinkCriteria

before or after

DoCmd.OpenQuery stDocName, acNormal, acEdit
 
Sorry, I edited my post to make that correction but apparently too late. Look again at the corrected syntax
 

Users who are viewing this thread

Back
Top Bottom