Hello,
I have a public variable strUserName. Access is picking it up from the login screen where users choose their name.
I'm opening a form whose data source is a table. In that table, there is a field chrAnalyst. When a user logs in (and Access picks up her strUserName), I'd like the form to open filtered for just her records. I think this should do it in my open event:
DoCmd.ApplyFilter , wherecondition:="[chrLeadAnalyst] = '" & strUserName & "'"
I've had trouble with the quotes in the past but I thought I had it figured out.
I get:
Run-time error '2046':
"The command or action 'ApplyFilter' isn't available now."
Why would it not be available? Is there something else I should use on an open event?
Help appreciated!