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!

.FindFirst - 3077 Syntax error (missing operator) in expression

Status
Not open for further replies.

doneg

Programmer
Jul 20, 1999
7
US
Could someone please tell me what is wrong with the following code.<br>
<br>
With rstDestination<br>
.FindFirst &quot;USERNAME = &quot; & strUserName<br>
<br>
The recordset is opened as a dynaset, the variable strUserName is obtained from a lookup in a different table and the correct value does show up here when the mouse pointer is over it. <br>
<br>
Any help would be appreciated
 
could you try<br>
<br>
.FindFirst &quot;USERNAME='&quot; & strUserName & &quot;'&quot;<br>
<br>
It has the effect of enclosing the variable strUserName in singles quotes - I'm just guessing from the way other things work to be honest.<br>
<br>
Mike <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Thanks Mike, that did it.<br>
I did not see that anywhere in the docs I saw.<br>
<br>

 
I vaguely remember it biting me as well. The problem is that the examples in the documentation all use numbers - so you don't need the single quotes.<br>
<br>
-ml<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top