Form frm3Comb has 2 data controls and 2 DBCombo boxes.
DataControl1 is connected to an Access database. RecordSource is a table that lists names of classes. DBCombo1 provides the list returned by DataControl1.
DataControl2 is connected to same database. DBCombo2 displays the list from DataControl2. I want to use a SELECT statement to return a list of the names in table tblPVM where the field SSClass is equal to the value of DBCombo1.
Can't figure out how to refer to the value of DBCombo1 in the statement.
If I use the statement
I get the error "Too few parameters. Expected 1."
If I change the statement to:
then I get the error "The Microsoft Jet database engine cannot find the input table or query..." followed by the statement.
What am I doing wrong?
DataControl1 is connected to an Access database. RecordSource is a table that lists names of classes. DBCombo1 provides the list returned by DataControl1.
DataControl2 is connected to same database. DBCombo2 displays the list from DataControl2. I want to use a SELECT statement to return a list of the names in table tblPVM where the field SSClass is equal to the value of DBCombo1.
Can't figure out how to refer to the value of DBCombo1 in the statement.
If I use the statement
Code:
SELECT tblPVM.PVMID, tblPVM.FullName, tblPVM.SSClass FROM tblPVM WHERE (((tblPVM.[SSClass]) = frm3Comb.DBCombo1)) ORDER BY tblPVM.FullName;
If I change the statement to:
Code:
"SELECT tblPVM.PVMID, tblPVM.FullName, tblPVM.SSClass FROM tblPVM WHERE (((tblPVM.[SSClass]) = " & frm3Comb.DBCombo1 & ")) ORDER BY tblPVM.FullName;"
What am I doing wrong?