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

basic query-form help

Status
Not open for further replies.

timekeepr9

Programmer
Jan 2, 2005
17
US
Hi, This is probably really basic, but I'm having a hard time combining access and sql. Basically, I have a table with three relevent columns, foreign key, behaviors and consequences. The foreign key refers to another table with a list of names. I have three combo boxes, names, behaviors and consequences. All I want to do is filter the table based on any or all of the three combo boxes, depending on what is selected.

For the behaviors and consequences, I want it to show a column if it includes the selected text, not just if it equals it. I think I need a sql statement something like:

WHERE behaviors LIKE %text% AND consequences LIKE %text2%

but I can't seem to get it to work. Anyone have any thoughts, or can point me towards some basic tutorial that does something similarly to this?

Thanks!
 
Like in Access use like this

[tt]Like "*" & [Forms]![FormName]![TextName] & "*"[/tt]
So you have to change the it as required
regards


Zameer Abdulla
Visit Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top