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

Select SQL statement

Status
Not open for further replies.

corbinap

Programmer
Nov 20, 2006
34
US
I have copied this from a query but I do not know how to end or close or format the Where statement which is causing the select statement not to work. And will this work for a table in the same database?

Set rs = Currentdb.OpenRecordset("SELECT tblSourcingManagers.MGR_Code "& _
"FROM tblSourcingManagers INNER JOIN tblUsers ON tblSourcingManagers.SourcingMgrID = tblUsers.SourcingMgrID " & _
"WHERE (((tblUsers.UserID)=[CurrentUser])) OR ((([currentuser]) In ('VP1','EVP','SD')))

 
Previously on this channel thread705-1305736
Code:
WHERE (tblUsers.UserID='" & [CurrentUser] & "')"
Following up
Code:
WHERE (tblUsers.UserID='" & [CurrentUser] & "') OR (tblUsers.UserID In ('VP1','EVP','SD'))
you return records of UserIDs :VP1, EVP, SD and the CurrentUser if he is listed in tblUsers table. Is this what you need?


10doesch: Why the extra thread in a different forum that covers VBA on Office in general? Better stick to the dedicated Forum705
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top