What is the syntax error?

gmc5135

Registered User.
Local time
Today, 18:28
Joined
Jul 10, 2012
Messages
25
As you can see in the attached database, I'm trying to make a search form. The query qalloy seems to work fine, but qoxsamples is giving me troubles. looking in SQL view, I tried modeling qoxsamples after qalloy. It won't let me save it, but the block of code at the bottom is what I was trying to use for the WHERE expression. I set it up the same, just with different text boxes and information. For some reason, when I go to save it, it says there is a syntax error in '(((OxSamples.SampleNo)=[forms]![searchform].[qsampleno] Or [forms]![searchform].[qsampleno] Is Null) AND ((OxSamples.TubeNo)=[forms]![searchform].[qtubeno] Or [forms]![searchform].[qtubeno] Is Null) AND ((OxSamples.Length)=[forms]![searchform].[qlength] O'. If I take that out, it says it again but for the next section of code which leads me to believe it is not that specific statement, but the way I'm setting it up. Any help is appreciated.

Code:
WHERE (((OxSamples.SampleNo)=[forms]![searchform].[qsampleno] Or [forms]![searchform].[qsampleno] Is Null) AND ((OxSamples.TubeNo)=[forms]![searchform].[qtubeno] Or [forms]![searchform].[qtubeno] Is Null) AND ((OxSamples.Length)=[forms]![searchform].[qlength] Or [forms]![searchform].[qlength] Is Null) AND ((OxSamples.OD)=[forms]![searchform].[qod] Or [forms]![searchform].[qod] Is Null) AND ((OxSamples.ID)=[forms]![searchform].[qid] Or [forms]![searchform].[qid] Is Null) AND ((OxSamples.InitialWeight)=[forms]![searchform].[qinitialweight] Or [forms]![searchform].[qinitialweight] Is Null) AND ((OxSamples.FinalWeight)=[forms]![searchform].[qfinalweight] Or [forms]![searchform].[qfinalweight] Is Null) AND ((OxSamples.HydridingRunNo)=[forms]![searchform].[qhydridingrunno] Or [forms]![searchform].[qhydridingrunno] Is Null) AND ((OxSamples.Hydrogen1)=[forms]![searchform].[qhydrogen1] Or [forms]![searchform].[qhydrogen1] Is Null) AND ((OxSamples.Hydrogen2)=][forms]![searchform].[qhydrogen2] Or [forms]![searchform].[qhydrogen2] Is Null) AND ((OxSamples.RackPosition)=[forms]![searchform].[qrackposition] Or [forms]![searchform].[qrackposition] Is Null));
 

Attachments

Your query sql seems to have a lot of garbage characters where you have copied something and pasted.
 

Users who are viewing this thread

Back
Top Bottom