Where condition based on either or field box

CLCoop

Board Regular
Joined
May 30, 2018
Messages
56
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: 8

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Put your where criteria into a string and Debug.Print that.
That will show you where you errors.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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
Back
Top