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!

Whats wrong with this SQL Satement?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
stLinkCriteria = "[Orders.Company]=" & "'" & Me![Company] & "'" & " [Date Ordered]=" & "'" & Me![Date Ordered] & "'"
 
Hi

I think you need a separator "," or ";" between the two fields, and if the dates in your statement are dateformat, you need to change to:

" [Date Ordered]=" & "#" & Me![Date Ordered] & "#"

Good luck, Roy-Vidar
 
If you are trying to use the values from the form text boxes then it should look like:

stLinkCriteria = "[Orders.Company]=" & Me![Company] & " [Date Ordered]= #" & Me![Date Ordered] & "#"

(assuming you put this all on one line)
(also assuming that Date Ordered is a date type that's why I suggested the #'s

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top