Docmd.applyfilter help

skp

Registered User.
Local time
Yesterday, 16:08
Joined
Feb 28, 2011
Messages
21
Have a database when a record is entered 1 of 2 letter types is selected. Either "LNR" or "AC". Trying to make it so when the "AC" checkbox is selected for mail merge only the records with that certain Letter type are selected to merge.

Tried this code on the checkbox but is not working:

DoCmd.ApplyFilter , "LetterType = 'AC"

Any suggestions?
 
First off - just get rid of the DoCmd.ApplyFilter part.

Go to this instead:

Me.Filter = "[LetterType] = " & Chr(34) & "AC" & Chr(34)
Me.FilterOn = True

You can use the single quotes though but you have to have one after the AC too:

Me.Filter = "[LetterType] = 'AC'"
Me.FilterOn = True
 

Users who are viewing this thread

Back
Top Bottom