Help with a DVD rental system

Markg

New member
Local time
Today, 14:19
Joined
Jan 13, 2009
Messages
6
Hi All,

I am currently trying to make a db for a DVD rental company. (Coursework)

I have set up Customer info, DVD info and a rental table. It only needs to be a relatively simple DB but I am having problem adding the following features.

-Automatically calculate and save the "Date Due back" value in the rental table. I would like a msgbox to ask how many days the loan is for.

-Once the person comes to return the DVD, how could I work out the cost??
I basically want this function;[IF(Due date > todays date) then (todays date- due date)*late rate+ (due date- withdraw date)*daily rate. else (due date- withdraw date)*daily rate.

I dont know where to enter this information, is it on a form, in the table or through a querry. How could i then save my calculations in designated tables?

thanks so much for your help

mark
 
what version of acccess are you working with and what office system

?
 
You can create that as a public function and stored in a module. The function can be called from a query or a form (button click event, likely). You will need to decide what parameters to be passed to the function and then return the appropriate result.

For your fees, you can probably create a constant (as double) in a module to store your fees or put in a table and create a function to get the value (better way).
 
Thanks for your replies,

Gary Panic: I am using Microsoft Office 2003 with Access 2003.

ezFriend- I am not very knowledgeable with the terminology that youre using. Is there anyway you can put it any simpler *sorry*

On my rental form I have the following fields,

RentalID, CustomerID, dvdID, Date rented, duration (In Days), Due Back, Late Fee, Total Fee.

CustomerID and dvdID are foreign Keys from the Customer and DvdInfo tables.

I want to use the Rental Form to enter new rentals and calculate normal and late fees.

I have set up a form to show all the records of the Rentals Table, I will keep it simple and use the table to input the data for now. My question is if that is possible or do i need to use text boxes to allow for manipulation?

Where would I enter the information to perform the calculation to automatically generate the due date using the rental date (default to todays date when adding new entry) and the duration? I think I need to use a dateADD function I just dont know where.

Thanks so much for your help

Mark
 

Users who are viewing this thread

Back
Top Bottom