Jump to content

Access VBA Confusion


Recommended Posts

Ok i'm not sure if this is complex or not (I hope not). In MS access 2007, I am creating a library database system, with members forms, book forms and issue forms.

 

When adding a book into the book table There is a check box called 'onShelf' which speaks for itself, if it is checked it is on the shelf, if not... then it isn't.

 

Now when this box is uncheck it won't be avaliable in the list of books that are able to be issued. (with me so far.. hope so).

 

Ok now when i issue a book i have another check box called 'Issued'. When this is checked it means the book is issued. When i check this box what i want the VBA code to do is uncheck the 'onShelf' checkbox making the book unavaliable in the list.

 

So the vba code i really need help with is

 

Private Sub issued_AfterUpdate()
   Dim SQLUpdate As String
   SQLUpdate = "UPDATE tbl.book SET onShelf=false WHERE bookID=_BOOKIDHERE_;"
   DoCmd.RunSQL SQLUpdate
End Sub

 

When i run this code i get the error

 

Run-Time error '3024':

 

Could not find path\to\documents\tbl.mdb

 

 

Any help would be great. Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/109863-access-vba-confusion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.