Runtime error 424: Object required

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gmazza via AccessMonster.com

    Runtime error 424: Object required

    Hi there,
    I am a novice at Access programming but I am flustered by this error and
    don't understand what I am doing wrong, any help is appreciated.
    Here is my code:
    Sub SetFilter()

    Dim LSQL As String

    LSQL = "select * from dbo_DDXLMO"
    LSQL = LSQL & " where St_Offshore = '" & cboSelected & "'"

    Form_frm_Offset Wells_sub.Recor dSource = LSQL

    End Sub

    I am calling the SetFilter routine from my Form_Open Procedure and all I have
    is a form and subform and in the form I have an unbound combo box that
    selects St_Offshore from table dbo_DDXLMO.
    I am just trying to populate the subform with results from my combo box and I
    keep getting this error and I have tried a million things and nothing is
    working.
    Please help, thanks!

    --
    Message posted via http://www.accessmonster.com

  • Salad

    #2
    Re: Runtime error 424: Object required

    gmazza via AccessMonster.c om wrote:
    Hi there,
    I am a novice at Access programming but I am flustered by this error and
    don't understand what I am doing wrong, any help is appreciated.
    Here is my code:
    Sub SetFilter()
    >
    Dim LSQL As String
    >
    LSQL = "select * from dbo_DDXLMO"
    LSQL = LSQL & " where St_Offshore = '" & cboSelected & "'"
    >
    Form_frm_Offset Wells_sub.Recor dSource = LSQL
    >
    End Sub
    >
    I am calling the SetFilter routine from my Form_Open Procedure and all I have
    is a form and subform and in the form I have an unbound combo box that
    selects St_Offshore from table dbo_DDXLMO.
    I am just trying to populate the subform with results from my combo box and I
    keep getting this error and I have tried a million things and nothing is
    working.
    Please help, thanks!
    >
    You might want to try the following format
    Forms!MainFormN ame!SubFormName .Form.Recordsou rce = ...
    or
    Me("SubFormName ").Form.Records ource = ...

    Brass

    Comment

    • gmazza via AccessMonster.com

      #3
      Re: Runtime error 424: Object required

      Salad wrote:
      >Hi there,
      >I am a novice at Access programming but I am flustered by this error and
      >[quoted text clipped - 18 lines]
      >working.
      >Please help, thanks!
      >
      >You might want to try the following format
      > Forms!MainFormN ame!SubFormName .Form.Recordsou rce = ...
      >or
      > Me("SubFormName ").Form.Records ource = ...
      >
      >Brass
      >http://www.youtube.com/watch?v=1qdvz0uPpNk

      I tried your suggestion and it now errors:
      Access can't find the field (SubFormName) referred to in your expression.
      Its not a field though, not sure what its talking about...
      Thanks for the fast response.

      --
      Message posted via AccessMonster.c om


      Comment

      • Pachydermitis

        #4
        Re: Runtime error 424: Object required

        On May 12, 3:05 pm, "gmazza via AccessMonster.c om" <u37142@uwewrot e:
        Salad wrote:
        Hi there,
        I am a novice at Access programming but I am flustered by this error and
        [quoted text clipped - 18 lines]
        working.
        Please help, thanks!
        >
        You might want to try the following format
           Forms!MainFormN ame!SubFormName .Form.Recordsou rce = ...
        or
           Me("SubFormName ").Form.Records ource = ...
        >>
        I tried your suggestion and it now errors:
        Access can't find the field (SubFormName) referred to in your expression.
        Its not a field though, not sure what its talking about...
        Thanks for the fast response.
        >
        --
        Message posted via AccessMonster.c omhttp://www.accessmonst er.com/Uwe/Forums.aspx/databases-ms-access/2008...
        lol. Form_frm_Offset Wells_sub.form. RecordSource = LSQL

        Comment

        Working...