Results 1 to 7 of 7
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: re: Application-defined or object-defined error

    Good Morning,

    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:
    Ms VB
    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

  2. #2
    Join Date
    Jul 2004
    Posts
    69
    str = "Select * from tblShipping_sched"
    set rst = New ADODB.Recordset
    rst.CursorLocation = adUseServer
    rst.Open str, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
    Set rptSampling_sched.DataSource = rst
    rptSampling_sched.Show
    Last edited by Daniel_Johns; 01-11-05 at 10:42.

  3. #3
    Join Date
    May 2002
    Posts
    395
    Hi Daniel,

    I tried your suggestion by adding .show in the code
    compile error:
    variable not defined
    ****rptSampling_sched.Show

    Application-defined or object-defined error
    **Set rptSampling_sched.DataSource = rst

    str = "Select * from tblShipping_sched"
    set rst = New ADODB.Recordset
    rst.CursorLocation = adUseServer
    rst.Open str, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
    Set rptSampling_sched.DataSource = rst
    rptSampling_sched.Show

  4. #4
    Join Date
    May 2002
    Posts
    395

    re:Application-defined or object-defined error

    Also I'm using AC2K and SQL SERVER 2000.
    AC2k may not support SHOW?
    THanks

  5. #5
    Join Date
    Jul 2004
    Posts
    69
    I tried your suggestion by adding .show in the code
    compile error:
    variable not defined
    ****rptSampling_sched.Show

    what is your report's name? i checked my code twice, there's no error on it.

  6. #6
    Join Date
    May 2002
    Posts
    395

    Re: Application-defined or object-defined error

    Hi Daniel,

    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?

  7. #7
    Join Date
    Jul 2004
    Posts
    69
    im trying to figure out what's going on there...gonna reply maybe if i got it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •