I am a newbie in Access and I have created a unbound report and am
trying to get data from 2 different queries. Previously, I had used the
ADODB recordset method to get data from tables and I have applied the
same logic to this case but using a query. But, when I try to run the
report I get the following error message: "No value given for one or
more required parameters." My code is as follows:
Dim rsPoles As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt = "SELECT Customer, Poles, Rate from qryPoleTotal"
rsPoles.Open SQLStmt, CurrentProject. Connection, adOpenDynamic,
adLockOptimisti c
rsPoles![Customer] = Me.Customer
rsPoles![Poles] = Me.SumOfPoles_
rsPoles![Rate] = Me.Rate
rsPoles.Update
rsPoles.Close
Set rsPoles = Nothing
(The coding is for only one query because I wanted to test it with one
before I added the second.)
I didn't use a WHERE clause because the query already has that logic
and I didn't use a union query because the two queries have different
fields and different data.
Can someone please help me with this problem.
Thank you in advance.
trying to get data from 2 different queries. Previously, I had used the
ADODB recordset method to get data from tables and I have applied the
same logic to this case but using a query. But, when I try to run the
report I get the following error message: "No value given for one or
more required parameters." My code is as follows:
Dim rsPoles As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt = "SELECT Customer, Poles, Rate from qryPoleTotal"
rsPoles.Open SQLStmt, CurrentProject. Connection, adOpenDynamic,
adLockOptimisti c
rsPoles![Customer] = Me.Customer
rsPoles![Poles] = Me.SumOfPoles_
rsPoles![Rate] = Me.Rate
rsPoles.Update
rsPoles.Close
Set rsPoles = Nothing
(The coding is for only one query because I wanted to test it with one
before I added the second.)
I didn't use a WHERE clause because the query already has that logic
and I didn't use a union query because the two queries have different
fields and different data.
Can someone please help me with this problem.
Thank you in advance.
Comment