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

Trouble with the Colon Character ":"

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
US
I decided to change a unique index in a table from an integer to a unique string. The string follows the format where the first character is a colon, eg :XV5067.

Now when I perform the following code I get an error:

Run Time error '3075':
Syntax Error in query expression 'TagName = :SEQ_V501".

Code:
DoCmd.OpenForm "frmCX1", acNormal, WhereCondition:="TagName = " & Me.TagName

Apparently Access doesn't like the colon character. I can't figure out a way around it; I read in the help about the dot and the question mark, but no comments on the colon.

What can I do to get around this? Removing the colon is not an option, unfortunately.

Thanks in advance!
Onwards,

Q-
 
Try this:
DoCmd.OpenForm "frmCX1", acNormal, WhereCondition:="TagName = '" & Me.TagName & "'" Kyle ::)
 
Thanks so much!! I figured it out about 30 minutes after I posted and then I couldn't get back on the Internet.

Thanks again!

Onwards,

Q-
 
This worked for me:

Code:
DoCmd.OpenForm "frmCX1", acNormal, WhereCondition:="TagName = " & "'" & Me.TagName & "'"

Exploded view:
Code:
" ' " & Me.TagName & " ' "

I don't know if the first post made it through, but thanks for responding Kyle! You rock!


Onwards,

Q-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top