Where condition based on either or field box

CLCoop

Board Regular
Joined
May 30, 2018
Messages
54
I have two boxes 1= Searchbox (a query with program names) and 2=SearchBox2 (a query with different program names). I'd like to have the user input in either box 1 or box 2 what they are wanting and it work for several different forms/reports. I do not want to combine the two programs into one query due to records will be added and additional flags depending on the program.

OpenForm:
Form Name: OTHER_INPUT_Allotments
View:
Filter Name:
Where Condition="[LOOK]=" & "'" & [SEARCHBOX] & "'" or ="[LOOK]=" & "'" & [SearchBox2] & "'" (this errors out so not sure if/what is needed or if have to change to VBA)
Data Mode: Edit
Window Mode: Normal

Can this be done?
as you can see there are OTHER FUNDS and STATE FUNDS that have different buttons to select from. The buttons when selected look at SearchBox 1 only... but I'd like it to look at Search Box 1 or SearchBox 2 to populate same report just with different programs in same table just with different funding codes, Fiscal Year, etc.
 

Attachments

  • Snip.PNG
    Snip.PNG
    30.2 KB · Views: 2

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

welshgasman

Well-known Member
Joined
May 25, 2013
Messages
908
Put your where criteria into a string and Debug.Print that.
That will show you where you errors.
 

Forum statistics

Threads
1,143,637
Messages
5,719,966
Members
422,251
Latest member
bonebreaker100

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top