Howie Jones
Registered User.
- Local time
- Today, 19:44
- Joined
- Aug 14, 2003
- Messages
- 15
Hi again
I want to replicate the 'Filter by selection' menu functionality in VBA to filter to the current record only.
DoCmd.ApplyFilter appears to only accept text as the = part of the argument.
If I Dim and set a variable CurRec to = SCOFull (a serial number that is unique to a given record)
DoCmd.ApplyFilter , SCOfull = CurRec - filters to include all of the records
DoCmd.ApplyFilter , "SCOfull = CurRec" - thinks CurRec is an undefined variable and pops up a dialogue box for you to type it in.
DoCmd.ApplyFilter , "SCOfull = 'CurRec'" - filters to a new record
What am I doing wrong? Or does DoCmd.ApplyFilter only work with a string input?
Regards
Howie
I want to replicate the 'Filter by selection' menu functionality in VBA to filter to the current record only.
DoCmd.ApplyFilter appears to only accept text as the = part of the argument.
If I Dim and set a variable CurRec to = SCOFull (a serial number that is unique to a given record)
DoCmd.ApplyFilter , SCOfull = CurRec - filters to include all of the records
DoCmd.ApplyFilter , "SCOfull = CurRec" - thinks CurRec is an undefined variable and pops up a dialogue box for you to type it in.
DoCmd.ApplyFilter , "SCOfull = 'CurRec'" - filters to a new record
What am I doing wrong? Or does DoCmd.ApplyFilter only work with a string input?
Regards
Howie