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!

Search for two things in one table 1

Status
Not open for further replies.

supervi

MIS
Mar 22, 2003
61
CA
I use the variable prodselected for a listbox population.

This is the code as of now


ProdSelected = ProdSelected & "WHERE [Fixed Block]![Contract Number ID] = '" & "AC" & "'"



So this will search the COntract Number ID field of my table for "AC"

Now what i want to do is search for AC OR SC. How would i go about doing that? This doesn't worK but i imagine it would look something like this.



ProdSelected = ProdSelected & "WHERE [Fixed Block]![Contract Number ID] = '" & "AC","SC" & "'"




I know this doesn't work but i want it to display the values that contain AC or SC

If their are any questions let me know
 
Hi!

[tt]ProdSelected = ProdSelected & "WHERE [Fixed Block].[Contract Number ID] IN ('AC','SC')"[/tt]

or
[tt]ProdSelected = ProdSelected & "WHERE [Fixed Block].[Contract Number ID] = 'AC' OR [Fixed Block].[Contract Number ID] ='SC'"[/tt]

Usually use dot (.) to as qualifier between table and fieldname

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top