Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47

    Unanswered: runtime error 2455

    hi all,

    I am very confused about a few lines of code.

    Well, I have these two procedures with the same lines of code but which work fine, except for when i open the form i get this error

    runtime error 2455" you have entered an expression that has an invalid reference to the property form/report"

    here are the two procedures

    this one works fine
    Private Sub ModelID_AfterUpdate()
    Me.Parent![subfrmAltoPartDetailLine]![PartNoID].Requery
    Me.Parent![subfrmAltoOptionDetailLine]![Alto_OptionID].Requery

    End Sub

    error occurs here only when the form is opened.
    Private Sub ModelID_GotFocus()
    Me.Parent![subfrmAltoPartDetailLine]![PartNoID].Requery
    Me.Parent![subfrmAltoOptionDetailLine]![Alto_OptionID].Requery
    End Sub

    thanks in advance
    Nerdy Girl

  2. #2
    Join Date
    Dec 2003
    Location
    Toronto, Ont. Canada
    Posts
    238

    Re: runtime error 2455

    Originally posted by nerdy_girl
    hi all,

    I am very confused about a few lines of code.

    Well, I have these two procedures with the same lines of code but which work fine, except for when i open the form i get this error

    runtime error 2455" you have entered an expression that has an invalid reference to the property form/report"

    here are the two procedures

    this one works fine
    Private Sub ModelID_AfterUpdate()
    Me.Parent![subfrmAltoPartDetailLine]![PartNoID].Requery
    Me.Parent![subfrmAltoOptionDetailLine]![Alto_OptionID].Requery

    End Sub

    error occurs here only when the form is opened.
    Private Sub ModelID_GotFocus()
    Me.Parent![subfrmAltoPartDetailLine]![PartNoID].Requery
    Me.Parent![subfrmAltoOptionDetailLine]![Alto_OptionID].Requery
    End Sub

    thanks in advance
    Okay... Since you say that the error only occurs when the Form is opened, I'm wondering if it is anything to do with this code at all...

    The bottom procedure is in the GotFocus event for ModelID... Does ModelID get focus as soon as the form opens?.... and if so, why would you want to requery as soon as the form opens?

    If I was you I'd set a break point in the form On Open or On Load event and then step through... This will show you exactly which line is giving you the error...

    HTH

  3. #3
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47
    thanks, will try that.
    Nerdy Girl

Posting Permissions

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