Q: Passing form text (with spaces) to a query (Access 2000)

M

MarkD

Hey,

So, I have a query where it's filtering on a form text
field: [Forms]![FRM_REPORTING]![txtEmployees]

the txtEmployees field in the form has the text "Homer
Simpson" without the quotes. The query isn't picking up
those records that have the name "Homer Simpson", but when
I enter that literal text in the filtering criteria, it
works fine.

I'm pretty sure this is a case of me not knowing how to
filter when a space is part of the filtering.

I've tried setting the text box equal to:
= "Homer Simpson"
= """" & "Homer Simpson" & """"
= 'Homer Simpson'

None of them work. The filter does work if I include a
name that doesn't have space.

Ultimately, I want to be able to be able to filter on
several employees ie "IN ('Homer Simpson','Bart
Simpson','Lisa Simpson')

how do I do this?

Thanks! This seems to be a much bigger problem than I
thought it'd be.
-Mark
 
K

Ken Snell

Filtering should not depend upon presence / absence of space in the text
string. Post the SQL of the query that you're trying to make work.

Are you setting the value of the textbox control on the form by using its
control source? Or is that just an example?

Is the form open when you run the query?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top