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

Recordset Syntax Problem

Status
Not open for further replies.

missymarie1014

Technical User
Mar 15, 2007
50
US
I have this code trying to retrieve data into a recordset. The problem is in the last section. The field 'InactiveProduct' is located in the BatchTemplateDetailQuery and is a true/false field. I am not sure how to write the code for that piece. Any help would be appreciated.

Code:
Set rs = CurDB.OpenRecordset("SELECT * from BatchTemplateDetailQuery WHERE" & _
(" TemplateID =" & Forms!CreateBatchFromTemplateForm!TemplateID) And (" InactiveProduct ='" & True & "'")
 
Don't put quotes around it, and clean up the placement of parenthesis
Code:
Set rs = CurDB.OpenRecordset("SELECT * from BatchTemplateDetailQuery WHERE" & _
" (TemplateID =" & Forms!CreateBatchFromTemplateForm!TemplateID & ") And (InactiveProduct = True)")

Joe Schwarz
Custom Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top