Re: Multi Field SQL Where Clause

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hank,

Yes, it should have been a single (double) quote, not three (double) quotes.
And the MsgBox should have been "MsgBox strWhere".

The variables should be Dim'd. Public makes them available to every module.




sysNtCoNo = sysPUOHCoNo
sysNtDvNo = sysPUOHDvNo
sysNtLcCd = sysPUOHLcCd
sysNtApLkNo = sysPUOHNo

In this section of code, what/where are

sysPUOHCoNo
sysPUOHDvNo
sysPUOHLcCd
sysPUOHNo


Are they control names? On a form?



Where is this function? Code behind a form or a standard module? If a form, what is the form name?
How are you calling the function? (a button?)

Why are you using a Function instead of a Sub?

Have you traced (stepped thru) the code? Where is the error?

What exactly doesn't work?

Are the fields

[NtCoNo]
[NtDvNo]
[NtLcCd]
[NtApLkNo]
[NtApLkLn]


in the recordsource for the form "NtMaint"?



Sorry for all the questions, but since I can't see your mdb, I have to be a two year old...... <grin>

Hang in there...

Steve S.
--------------------------------
"Veni, Vidi, Velcro"
(I came, I saw, I stuck around.)

Hank@ieultd wrote:
Hello Again Steve;
I haven't given up yet of course so here goes.
The triple quotes cause a syntax error. When I remove the two additional quotes the syntax error goes away but the functionality is still absent. Do the definitions have to be DIM rather than PUBLIC as in Public sysNtCoNo as Single
Public sysNtDvNo as Single
Public sysNtLcCd as Single
Public sysNtApLkNo as Long
etc. Note the co/dv & lc are single fixed fields. I don't know if that makes a difference with the quotes within the string or not.
Also note, when using the string as you have defined it the correct values are displayed so it has to be close to correct. Just can't identify the obvious probably.
Thanks Again for all your help!!!
hank

.



Relevant Pages

  • Re: Multi Field SQL Where Clause
    ... Dim sysform As String ... Dim sysNtSysCd As String ... sysNtDvNo = sysPUOHDvNo ... The triple quotes cause a syntax error. ...
    (microsoft.public.access.forms)
  • Re: VB INSERT INTO
    ... Numeric value shouldn't have quotes around them, so if, for example, ... -2147217900 Syntax error in INSERT INTO statement. ... strSQL" without the quotes. ... Set conDatabase = CurrentProject.Connection ...
    (microsoft.public.access.modulesdaovba)
  • Re: running vbscript syntax error
    ... A string must be passed to the Run method. ... The double quotes in the string are resolved to single quotes. ... To troubleshoot, run a script where you define the value of strCmd as above, ... is a syntax error, perhaps due to unbalanced quotes, you can fix it. ...
    (microsoft.public.scripting.vbscript)
  • Re: [opensuse] Script wizards help needed
    ... Insert the other HTML you need where the "..." ... Hi Tim ... syntax error near unexpected token `<' ... Leave the outermost quotes as regular quotes, ...
    (SuSE)
  • Re: [opensuse] Script wizards help needed
    ... Pete. ... Just watch the quoting - all the double quotes in the HTML need to be ... syntax error near unexpected token `<' ...
    (SuSE)