Unanswered: re: Application-defined or object-defined error
I am trying to set my report's recordsource by using the code below in the report open event but it is giving me this error message:
Runtime error 2465
Application-defined or object-defined error
The same code is used in open form event and works fine.
Any help would be appreciated.
Private Sub Report_Open(Cancel As Integer)
str = "Select * from tblShipping_sched"
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseServer
rst.Open str, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Reports("rptSampling_sched").Recordset = rst
My report's name is rptSampling_sched.
Every time when I type in an object vba will pop up a list of method or properties to choose from but when I typed in rptSampling_sched. no pop up came up. Does this means there are no methods or properties support for the object? I'm using Access 2000. Which one are you using?