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 derfloh 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
Joined
Sep 25, 2001
Messages
97
Location
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?? 8-)
 
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