vaioprincess
06-26-2010, 02:48 PM
Hello,
I am writing a program that consists of multiple user defined picklist values and will pull data from Access based on what is defined. Rather than write code for any possible combination of variables, I want to just pull all values if the variable is undefined - basically, set that variable to a wildcard to tell Access to give me all values for that field that match the other criteria.
I wrote this code for all of the picklist variables:
If Sheets!Grouping.GrpPickList.Value = "" Then VALUE = "" * "" Else If Sheets!Grouping.GrpPickList.Value <> "" Then VALUE = Sheets!Grouping.GrpPickList.Value
The red part is what I am having problems with. In this statement, how do you make the value be a wildcard character? I have tried quotes and apostrophes and get different errors or no data is returned.
Thanks.
I am writing a program that consists of multiple user defined picklist values and will pull data from Access based on what is defined. Rather than write code for any possible combination of variables, I want to just pull all values if the variable is undefined - basically, set that variable to a wildcard to tell Access to give me all values for that field that match the other criteria.
I wrote this code for all of the picklist variables:
If Sheets!Grouping.GrpPickList.Value = "" Then VALUE = "" * "" Else If Sheets!Grouping.GrpPickList.Value <> "" Then VALUE = Sheets!Grouping.GrpPickList.Value
The red part is what I am having problems with. In this statement, how do you make the value be a wildcard character? I have tried quotes and apostrophes and get different errors or no data is returned.
Thanks.