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!

Parameter query

Status
Not open for further replies.

eussias

Programmer
Sep 25, 2001
97
AU
I'm trying to open a recordset using a specific parameter query, and for some reason (simple I'm sure) it's not opening. Saying there are too few parameters. Below is the line of code I'm trying to use...

Set rst = CurrentDb.OpenRecordset("SELECT * FROM UserList WHERE [UserName] = " & txtUserName.Text & "")

txtUserName is a text box where the user enters their user name. Can anyone see what I'm doing wrong here?? :cool:
 
Set rst = CurrentDb.OpenRecordset("SELECT * FROM UserList WHERE [UserName] = '" & txtUserName.Text & "'")

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top