Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Object Required (Access 2003)

    Hi

    After updating each form in my database, I would like to read some SQL from the same DB to determine a record status that will be later used to update a specific table if changed (not yet coded).

    I tried this:

    Private Sub Form_AfterUpdate()
    Dim rstA As DAO.Recordset
    Dim StatusValue As String

    Set rstA = CurrentDB().OpenRecordset("select * from stqryExtract where tabkey = '" & Me!TabKey & "'")

    If rstA.NoMatch Then
    MsgBox "Record not found"
    Else
    If (rstA!ToBeReviewed Is Null) Then
    StatusValue = "01"
    etc.....
    End If
    End If
    rstA.Close
    End Sub
    The above code suffers with a run-time error '424' - object required for the code line "If (rstA!ToBeReviewed Is Null) Then".
    1) What can I do to amend the problem?
    2) For the functionality required and speed and efficiency, would I have been better served to use ADO or DAO, QueryDef or Recordset? Any recommendations?

    Thanks

    WILLS

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Object Required (Access 2003)

    I believe you need to change that line to read:
    <font color=blue>If IsNull(rstA!ToBeReviewed) Then</font color=blue>

    As to ADO versus DAO, frankly not much difference performance wise unless you do thousands or millions of checks. Even then, depending on the circumstances, one or the other may be faster, at most by 10% or so.
    Wendell

Posting Permissions

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