Db-why-not
Registered User.
- Local time
- Today, 17:25
- Joined
- Sep 17, 2019
- Messages
- 159
I created a function it is named module 1 fCboSearch(vCboSearch As Variant) IT takes the value from a dropdown box cboTechnician on my main form. I want it to show all records if "All Data Technicians" in my query if it is selected from dropdown list if not I want it just to use filter the 1 value selected.
In my query criteria I put fCboSearch(vCboSearch As Variant)
When I run the query it gives me an error message.
In my query criteria I put fCboSearch(vCboSearch As Variant)
When I run the query it gives me an error message.
Code:
Option Compare Database
Option Explicit
Public Function fCboSearch(vCboSearch As Variant)
vCboSearch = Forms!Welcome_menu!cboTechnician
If vCboSearch = "All Data Technicians" Then vCboSearch = "*" Else
vCboSearch = Forms!Welcome_menu!cboTechnician
End
fCboSearch = vCboSearch
'sets value of fCboSearch
End Function