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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Find help

Status
Not open for further replies.

vz

MIS
Jul 31, 2001
131
US
I have a find statement that takes whats in a text box and searches a recordset for it but its not working can anyone tell me why?

Dim tempAcctNum As String
tempAcctNum = txtAccountNum
adotblaccounts.Recordset.Find "AccountNum=tempAcctNum"

this blows up and says its out of acceptable range, AccountNum is the name of my field which is of type text.

But if i put this in, it works:
adotblaccounts.Recordset.Find "AccountNum=123123"

Am I doing something wrong?
Thanks
 
Nevermind i figured it out:

adotblaccounts.Recordset.Find "AccountNum='" & tempAcctNum & "'"

thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top