ApplyFilter syntax problem

WinDancer

Registered User.
Local time
Today, 03:37
Joined
Oct 29, 2004
Messages
290
I have been fighting with this code the whole day- help, please?

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmTabSurvey"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.ApplyFilter , "Text59 = 'Tables!StoreSurveyNumber!StoreSurveyNumber'"

I want to open the form to the form number stored in the unopened table. Both fields are long integer.

This latest attempt is asking for the paramater value...

Thanks,
Dave
 
I would use the wherecondition rather than filtering after the fact, but try this:

DoCmd.ApplyFilter , "Text59 = " & DLookup("StoreSurveyNumber", "StoreSurveyNumber")
 
I tried that and it still is asking for the parameter.
Does it require a different method of reference when trying to get a value from a closed table?
 
The DLookup will do that. Do the table and field really have the same name? If you're getting a parameter prompt, odds are one of those is wrong. Here's the syntax (if you only have one record, no criteria is needed):

http://www.mvps.org/access/general/gen0018.htm
 
I read the edrror message more closely- it was the fill-ee and not the fill-er that had the bad syntax. Thanks for your help and the fix!
Dave
 

Users who are viewing this thread

Back
Top Bottom