Plese help...i'm tearing my hair out....
the query 'qry_rpt_General' is a parameter query that users 'Between [Forms]![print Bulletin]![Start_date] And [Forms]![print Bulletin]![End_date]' as its parameter,
if i run the query it works fine and gives me the correct result
when i execute the following code it gives an error, 'one or more parameters are missing'
if i take the parameter request out of the query the code runs fine....
any ideas why it doesn't pick up the parameters? (they are on a form and the form is open)
Dim rst As New ADODB.Recordset
Dim SQLstr As String
Set dbs = CurrentDb
SQLstr = "SELECT bibref_id, date_imput FROM qry_rpt_General"
rst.Open SQLstr, CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdText
intaccnum = 1000
rst.MoveFirst
Do Until rst.EOF
MsgBox (rst![bibref_id])
SQLstr = "UPDATE tblbibliog " & _
"SET accession_number = " & intaccnum & _
" WHERE bibref_id = " & rst![bibref_id]
MsgBox (SQLstr)
'dbs.Execute SQLstr
intaccnum = intaccnum + 1
rst.MoveNext
Loop
the query 'qry_rpt_General' is a parameter query that users 'Between [Forms]![print Bulletin]![Start_date] And [Forms]![print Bulletin]![End_date]' as its parameter,
if i run the query it works fine and gives me the correct result
when i execute the following code it gives an error, 'one or more parameters are missing'
if i take the parameter request out of the query the code runs fine....
any ideas why it doesn't pick up the parameters? (they are on a form and the form is open)
Dim rst As New ADODB.Recordset
Dim SQLstr As String
Set dbs = CurrentDb
SQLstr = "SELECT bibref_id, date_imput FROM qry_rpt_General"
rst.Open SQLstr, CurrentProject.Connection, adOpenDynamic, adLockOptimistic, adCmdText
intaccnum = 1000
rst.MoveFirst
Do Until rst.EOF
MsgBox (rst![bibref_id])
SQLstr = "UPDATE tblbibliog " & _
"SET accession_number = " & intaccnum & _
" WHERE bibref_id = " & rst![bibref_id]
MsgBox (SQLstr)
'dbs.Execute SQLstr
intaccnum = intaccnum + 1
rst.MoveNext
Loop