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

I have written the following code:

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I have written the following code:

Dim db As Database
Dim rst As Recordset
Dim strSQL As String
Dim WO As String
WO = Me![WO#]

Set db = CurrentDb
strSQL = "Where [FieldWO] = " & WO

Set rst = db.OpenRecordset("Select * from [tbl Field Input] " & strSQL)

I get a "Data Mismatch in Criteria Expression everytime I run this code. [FieldWO] is set up as text. Any help would be appreciated!
Thanks,
Bill Heath
 
Hi Bill,
Please try:

strSQL = " Where FieldWO = '" & WO
strSQL = "Select [tbl Field Input].* from [tbl Field Input] " & strSQL & "'"

Set rst = db.OpenRecordset(strSQL)

Might just work... :) Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top