Results 1 to 2 of 2
Thread: Object Required (Access 2003)
2005-11-29, 21:09 #1
- Join Date
- Aug 2004
- Thanked 0 Times in 0 Posts
Object Required (Access 2003)
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"
If (rstA!ToBeReviewed Is Null) Then
StatusValue = "01"
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?
2005-11-29, 21:16 #2
- Join Date
- Aug 2001
- Evergreen, CO, USA
- Thanked 65 Times in 64 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