delete macro

loveforfire33

New member
Local time
Yesterday, 20:53
Joined
Mar 19, 2009
Messages
6
Hi guys,

im very very new to databases so i warn you in advance!

i basically have im developing a lending system for library. and i have created a form to be used when a book is returned.

the user searches for the record by book number and it brings up the details of the current loan.

i need a macro to clear 3 cells that are brought up by the search function (borrowerid, loan issue date, loan reutrn date) and then save the record. any pointers in the right direction would be great as i have no idea where to start!

thanks
 
Use SetValue action and have the field names as the Item and Null as the expression. Follow the SetValue actions with RunCommand and select SaveRecord from the drop down menu.

After you have made you macro then right click on it and Save as Module and then you will see what the macro looks like in VBA (code)
 
i need a macro to clear 3 cells that are brought up by the search function (borrowerid, loan issue date, loan reutrn date) and then save the record. any pointers in the right direction would be great as i have no idea where to start!

i assume then that for each book. you are only storing the current lend

this may be OK, but you lose all the history of previous boorrowings
eg, what books each user has borrowed, how many lends per book etc

what you would normally have is a separate "lending" table linked to each book and each user (only 1 lending table), so that all previous lends are stored - so you dont clear anything - if its a new lend, you create a new lending record for the book for EACH New lend.
 
thanks very much for the reply gemma,

i have adopted what you said and now all lends are stored in a lend table.

the only problem i have now is that my system allows a user to enter a book number that is allready on loan.

as the table is going to be storing many instances of the same copy being loaned at seperate times to seperate people i have made the primary key a compound of (book id, borrower id, and date issued)

can anyone think of a workaround to this so the user cannot enter a book id that is currently on loan? (the other feilds in the table are due date and, return date)

also im unsure about how the table will work with regard to returning a book, how can i specifiy which record needs updating when entering a returned date - as again there will be more than one instance of the same book id in the table
 
Last edited:
Hi mate, I'm also just about to start a similar Database and have been looking for info on how to write it so any pointers you could give would be really beneficial.
I'm a poor novice at this too, but trying to get better.

Cheers
 

Users who are viewing this thread

Back
Top Bottom