run-time error 424 object required 
Author Message
 run-time error 424 object required

I am trying to learn how to write VBA and I copied this right out of the
book , but I keep getting  this runtime error 424 object required...and I
just cant figure out where I might have gone wrong...I re-read the code both
out of the book and as I typed it several times line by line but I just cant
seem to find the error....I now think that it is in the book and not my
writing/copying....this is the code:

Sub exDMLample()

Dim rsBooks As Recordset

Set dbLibrary = ws.OpenDatabase("C:\dao\library.mdb")

Set rsBooks = dbLibrary.OpenRecordset("BOOKS")

rsBooks.AddNew
rsBooks!ISBN = "0-99-345678-0"
rsBooks!Title = "DB Programming Isn't Fun"
rsBooks.Update
rsBooks.AddNew
rsBooks!ISBN = "0-78-654321-0"
rsBooks!Title = "DB Programming Isn't Fun"
rsBooks.Update

rsBooks.Index = "ISBNIdx"

rsBooks.MoveFirst
MsgBox "ISBN: " & rsBooks!ISBN & " TI: " & rsBooks!Title
rsBooks.MoveNext
MsgBox "ISBN: " & rsBooks!ISBN & " TI: " & rsBooks!Title

End Sub




Wed, 22 Oct 2003 13:39:03 GMT  
 run-time error 424 object required
I don't see where 'dbLibrary' and 'ws' are declared?

--
Brendan Reynolds

http://www11.ewebcity.com/brenreyn


Quote:
> I am trying to learn how to write vba and I copied this right out of the
> book , but I keep getting  this runtime error 424 object required...and I
> just cant figure out where I might have gone wrong...I re-read the code
both
> out of the book and as I typed it several times line by line but I just
cant
> seem to find the error....I now think that it is in the book and not my
> writing/copying....this is the code:

> Sub exDMLample()

> Dim rsBooks As Recordset

> Set dbLibrary = ws.OpenDatabase("C:\dao\library.mdb")

> Set rsBooks = dbLibrary.OpenRecordset("BOOKS")

> rsBooks.AddNew
> rsBooks!ISBN = "0-99-345678-0"
> rsBooks!Title = "DB Programming Isn't Fun"
> rsBooks.Update
> rsBooks.AddNew
> rsBooks!ISBN = "0-78-654321-0"
> rsBooks!Title = "DB Programming Isn't Fun"
> rsBooks.Update

> rsBooks.Index = "ISBNIdx"

> rsBooks.MoveFirst
> MsgBox "ISBN: " & rsBooks!ISBN & " TI: " & rsBooks!Title
> rsBooks.MoveNext
> MsgBox "ISBN: " & rsBooks!ISBN & " TI: " & rsBooks!Title

> End Sub





Wed, 22 Oct 2003 18:19:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Run-Time Error 424, Object-Required.

2. Run time error 424 Object Required

3. Run time error 424 - object required!

4. Run time error 424 - object required!

5. Fixing run-time error 424: object required (DBEngine)

6. Run-Time Error 424: Object Required

7. Run time error 424 - object required!

8. Run time error 424 - object required!

9. Run-time error 424: object required

10. Run-time error 424: object required.

11. Runtime error 424: Object required

12. runtime error 424 object required

 

 
Powered by phpBB® Forum Software