When running a report, i get an error
"Run-time error '-2147352567 (80020009)': You can't assign a value to this
object."
I have a text field, rptAlloy, and want to fill it with a field from a query
that filled from the form that generates the report...i.e. Form to view
data->click preview/print report->qyr runs->report is generated
here is the code for when the rpt opens up:
Private Sub Report_Open(Cancel As Integer)
Dim C1894db As Database
Dim rst As Recordset
Set C1894 = CurrentDb
Set rst = C1894.OpenRecordset("qryReport")
MsgBox (rst!Alloy)
Me.rptAlloy = rst!Alloy
End Sub
i have the MsgBox as a test, and the MsgBox comes up with the right entry,
however the textbox i want to store the value in won't accecpt the value.
any suggestions? (i have about 25-30 fields, and i wanted to keep the same
formatting as the form view, so i copied the form, and pasted it in the
report, but then "redrew everything from scratch...)
Stefan Hoffmann - 01 Nov 2006 15:32 GMT
hi Mike,
> Private Sub Report_Open(Cancel As Integer)
>
> Dim C1894db As Database
> Dim rst As Recordset
Better:
Dim C1894db As DAO.Database
Dim rst As DAO.Recordset
> Set C1894 = CurrentDb
The here used variable is undeclared as you declared C1894db (db at the
end).
mfG
--> stefan <--
Mike - 01 Nov 2006 15:47 GMT
I made the changes, and still i get the same thing.
> hi Mike,
>
[quoted text clipped - 13 lines]
> mfG
> --> stefan <--