A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Syntax error



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2004, 02:54 AM
GitarJake
external usenet poster
 
Posts: n/a
Default Syntax error

Can someone tell me what's wrong with this statement? I keep getting a
syntax error when I try to add a combo box to this form.

SELECT DISTINCTROW Contacts.UNIQUE_ID, Users.Name AS NovoName,
Contacts.Company, Contacts.Contact, Contacts.IDStatus, Contacts.[Create
Timestamp] AS CreateDate, Contacts.Phone, Contacts.[Web Site],
Contacts.Industry, Contacts.[Address 1], Contacts.City, Contacts.State,
Contacts.Zip, Contacts.Country
FROM (Contacts INNER JOIN Sales ON Contacts.UNIQUE_ID = Sales.Contact) INNER
JOIN Users ON Sales.[Record Manager] = Users.UNIQUE_ID
WHERE (((Contacts.IDStatus) Like "*customer*"))
ORDER BY Contacts.Company;

Thanks,

Jake


  #2  
Old April 27th, 2004, 03:59 AM
GitarJake
external usenet poster
 
Posts: n/a
Default Syntax error

Hello all,

I think I am running into trouble here with my Unique_IDs. They are
generated by a 3rd party application and I pull them down monthly for sales
reports, etc. I've listed a few below:

5 A!\]\
Y .1^S]
"T\" _!'&_

My combo boxes and listboxes always seem to blow up on records that have a
single quote ' in their Unique_ID. I get the message: Runtime error
'3077': Syntax error in expression.

If I select records that don't have a single quote in the Unique_ID field,
they populate the form.

I can't change the format or makeup of the Unique_ID's as I am pulling them
from a 3rd party app. But, can I change them somehow on import? Or wrap
them in something so the "Findfirst" statements don't crash?

TIA,

Jake


"GitarJake" wrote in message
news:%3jjc.424$NZ4.319@lakeread05...
Can someone tell me what's wrong with this statement? I keep getting a
syntax error when I try to add a combo box to this form.

SELECT DISTINCTROW Contacts.UNIQUE_ID, Users.Name AS NovoName,
Contacts.Company, Contacts.Contact, Contacts.IDStatus, Contacts.[Create
Timestamp] AS CreateDate, Contacts.Phone, Contacts.[Web Site],
Contacts.Industry, Contacts.[Address 1], Contacts.City, Contacts.State,
Contacts.Zip, Contacts.Country
FROM (Contacts INNER JOIN Sales ON Contacts.UNIQUE_ID = Sales.Contact)

INNER
JOIN Users ON Sales.[Record Manager] = Users.UNIQUE_ID
WHERE (((Contacts.IDStatus) Like "*customer*"))
ORDER BY Contacts.Company;

Thanks,

Jake




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.