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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date query error in VBA

Status
Not open for further replies.

Bristowj

Programmer
Jul 4, 2001
7
GB
Hi,
I have two forms in Access, the first form takes a string with a WHERE clause enclosed and passes it to the second form using the docmd.openform command.
The problem I am having is that my primary key field for the table I am accessing is called [ID #].
When referencing this field Access thinks I am trying to pass a date value!
I have tried to enclose the ID # field inside [] but to no avail.
I cannot change the name of the primary key because of system references.
Does anyone know of a possible workaround.
Many thanks
Jonas
%-(
 
Hi Jonas!

Could you post the code? I tried this (enclosing the ID # in []) and it worked well for me. I know that in some cases, with special characters, you need to use two of them so that Access understands that you are not using it's special meaning, but I thought that was just for operands. If you will post the code that is giving you trouble, I might be able to help better.

Jeff Bridgham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top