Variable entry for Form Filter

JCShort

Registered User.
Local time
Today, 12:56
Joined
Aug 29, 2008
Messages
35
I want to filter a form using variable input from the user. I simply want the user to be able to input his/her name and the form will filter only records that apply to him/her. I'm assuming the VBA starts like this:

Form.Filter = "User =" &

How would I complete that statement or am I completely off base?

Thanks!
 
I added a combobox called User_Select where the user can select his/her name. Now, I want the code to filter the form based on the User field so I updated the code to read:

Form.Filter = "User = " & User_Select.Value & " "

But I don't know what character I need to place after the = and between the "". If it was a number or date, I would write:
"User = #" & User_Select.Value & "#"

But I don't know what character to use for string values. I've tried a few variations of ' but that isn't working.

Thanks again!
 
Form.Filter = "User = """ & User_Select.Value & """"

That works like a charm. I wasn't adding enough quotes originally. I'll make sure to spend more time troubleshooting before posting again. Tight deadline to get this DB up and running has me scatterbrained.
 

Users who are viewing this thread

Back
Top Bottom