Hello. I'm trying to use the following statement with a (temporarily defined) recordset. I keep getting the 3077 error: "syntax error in string," no matter how I try to rearrange the quote marks. What's the proper syntax?
Code:
with myRecordset
.FindFirst "[ShotNumSuffix] = " & Nz(varShotNumSuffix, " ") & "
The field is typed as a string, but may be null.
varShotNumSuffix is typed as a string, but may be null. If it is null, I want to set ShotNumSuffix to
a zero length string (but leave it alone if it has some alphabetic value). However, even when I take precaution of first setting both the field and the variable to " ", I'm still getting
the error. This is probably a newbie quote mark issue, but keeps hanging me up.
Thanks for any help.
-Ron
Edit - I'm aware that the definition of the NZ function prescribes that the variable should be typed as variant. Is that literally mandatory, or does it mean the variable could be any type? Pretty sure I've seen it used for string variables.