using @ (such as [email protected]) in recordsource property

  • Thread starter paul a via AccessMonster.com
  • Start date
P

paul a via AccessMonster.com

hi..

I am building recordsource of a form A from another form, form B, using vba.
I need to use email address as one of the query criteria.
i.e., the recordsource property is something like

select * from tableA where email='(e-mail address removed)'

now, when formA opens, it asks input for 'abc.com' because it (e-mail address removed)
is a variable...

is there any escape characters I can use?
i've tried [@], double quotes, \@, etc... but no avail..
how can I get around this??

Thanks~~
 
D

Douglas J Steele

In general, you use square brackets around special characters. However,
since you're using =, not Like, I wouldn't have expected Access to complain
about the @.
 
D

Dirk Goldgar

paul a via AccessMonster.com said:
hi..

I am building recordsource of a form A from another form, form B,
using vba. I need to use email address as one of the query criteria.
i.e., the recordsource property is something like

select * from tableA where email='(e-mail address removed)'

now, when formA opens, it asks input for 'abc.com' because it
(e-mail address removed) is a variable...

is there any escape characters I can use?
i've tried [@], double quotes, \@, etc... but no avail..
how can I get around this??

I'm not finding any problem with a SQL statement like that as the
recordsource for a form. If you're setting the recordsource at run
time, I suspect there's a flaw in your VBA code. Post it and we'll see
what's the matter.
 

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