M
Mike Waller
I have been trying to perform a simple Select query using
an SQL statement in VBA. However, one element is not
working. At the end of my Select statement I am trying to
compare a table value (Battery) to an entry on a form
(variable rptType) and it isn't working. I get an
error "No value given for one or more required
parameters". If I substitute a literal value, the query
works fine. The code is attached;
rptType = Me!Type
Set rsReport = New ADODB.Recordset
rptTable = "SELECT Pin1, Temp1, Spec1 FROM Test WHERE
Battery = rptType "
rsReport.Open rptTable, cnCurrent
Thanks,
Mike
an SQL statement in VBA. However, one element is not
working. At the end of my Select statement I am trying to
compare a table value (Battery) to an entry on a form
(variable rptType) and it isn't working. I get an
error "No value given for one or more required
parameters". If I substitute a literal value, the query
works fine. The code is attached;
rptType = Me!Type
Set rsReport = New ADODB.Recordset
rptTable = "SELECT Pin1, Temp1, Spec1 FROM Test WHERE
Battery = rptType "
rsReport.Open rptTable, cnCurrent
Thanks,
Mike