Using the Like operator

caddyboy

New member
Local time
Yesterday, 23:23
Joined
Nov 10, 2013
Messages
2
Good Evening,

I have a question. It may be simple and sorry if it is. I am using MS Access 2013.

I am using the BrowseTo action in a macro. It is placed in a form which is located on my main page. The macro works fine however when I select the desired result from the combo box it displays all records (from the "Make" column - I get all the make records i select). In my query I have a field (from the table, Data Type is Yes/no) named Reviewed.

When I select the make from the combo box I want the option to display if I have reviewed the item or not before the results are displayed. Can this be done?

This is the code I have so far

="[Make] LIKE '" & [cbo_Make] & "*'"

I guess my question is what code do I need to add to the Where Condition in the macros to get this to work in the manner that I wish it would?:banghead:

Thanks in advance for any reply!
 
When I select the make from the combo box I want the option to display if I have reviewed the item or not before the results are displayed. Can this be done?

This is the code I have so far

="[Make] LIKE '" & [cbo_Make] & "*'"

Usually LIKE is used for a textbox search. So you let the user choose a term to search for so if you had a list of names

"WHERE [Name] LIKE '*" & [txt_Name] & "*'"

If you had Names of ALICE, ALEX, ALAN if the User typed AL and pressed Search it would show all 3.

If you have a combo box with those values pre filled from your Table you can just say:

"WHERE [Make] = '" & [cbo_Make] & "'"

As this should match as they are values you have already put in the Table.
 

Users who are viewing this thread

Back
Top Bottom