W
Wayne Emminizer
I am trying to set a combo box's row source in VBA. When
I define that rowsource with no where clause (ex.1) or
with a where class but with no variable (ex.2) the proper
data is displayed. When I add a variable that is defined
through another function in the form though the where
clause does not "expand" but just shows the variable name
(ex.3)
ex.1 (No Where Clause) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster;"
ex.2 (Defined Where Clause) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster WHERE
[vueItemMaster.Species]='Abalone';"
ex.3 (With Variable) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster WHERE &
sqlFilter &"";"""
In example 3 sqlFilter is defined as a string value that
is built in code after each choise from a drop down. The
result that diaplys in the property sheet using ex.3 is
as follows:
SELECT DISTINCT vueItemMaster.SubSpecies FROM
vueItemMaster WHERE & sqlFilter &";"
As you can see, sqlFilter is not expanding to
[vueItemMaster.Species]='Abalone'
What am I missing?
I define that rowsource with no where clause (ex.1) or
with a where class but with no variable (ex.2) the proper
data is displayed. When I add a variable that is defined
through another function in the form though the where
clause does not "expand" but just shows the variable name
(ex.3)
ex.1 (No Where Clause) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster;"
ex.2 (Defined Where Clause) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster WHERE
[vueItemMaster.Species]='Abalone';"
ex.3 (With Variable) - strSQL = "SELECT DISTINCT
vueItemMaster.SubSpecies FROM vueItemMaster WHERE &
sqlFilter &"";"""
In example 3 sqlFilter is defined as a string value that
is built in code after each choise from a drop down. The
result that diaplys in the property sheet using ex.3 is
as follows:
SELECT DISTINCT vueItemMaster.SubSpecies FROM
vueItemMaster WHERE & sqlFilter &";"
As you can see, sqlFilter is not expanding to
[vueItemMaster.Species]='Abalone'
What am I missing?