Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2003 Reserved Word Workaround

Status
Not open for further replies.

elinsd

Programmer
Oct 22, 2002
32
0
0
US
Hi,

I just migrated from A2K project to A2K3. A2K3 has a new reserved word '@' that causes a problem issue for my application. I have a text field with email addresses, if I try to filter using this field on the form, Access would just take something like 'abc@xyz.com' and translates it into 'abc?' so my filter won't work.

What are the workarounds I can use? Thanks much for any help.
 
I just tried that and had no issue. In a text field on a form I filtered for 'AAAA@3333' which was some dummy data I had in a table and it filtered as expected.

I have a text box and a command button. When I press the command button, I set the filter to the content of the text box and set FilterOn to true.

Works as expected in Access 2003. What else could the problem be because I do not think Access cares about the @ symbol inside your string.

 
I just thought of a very simple workaround of my problem after checked my VBA reference library, tried some other workarouds then it just came to me that I only needed to use REPLACE method to modify the value of my filter to something like 'abc%xyz.com' and passed it to a SQL string for filtering the record source since it's the '@' symbol kept giving me problems.

By the way, sorry, I wasn't clear on where exactly this happened. The '@' seems to work fine if it's in a stand-alone query but it doesn't work when you put the same query code to work as a form's record source as I tried to manipulate the form's data with a filter through VBA, it didn't work. I might have to configure something to eliminate this problem but I really think this is a Microsoft bug.

Hope this would help someone who comes across the same problem.
 
like 'abc%xyz.com'
if the underlaying database is SQL-Server then @ is a reserved character for parameters.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top