Advice Required (1 Viewer)

C00ki3

New member
Local time
Today, 10:41
Joined
Nov 20, 2003
Messages
5
Urgent!! Aid or Advice required

Peace,

I am working on a Library booking system, up to now it has the ability to :

Add Items
Add Members
Loan Items

However it can not completely Loan Out Items, as the 'return date' field is the one i am experiancing lots of problems with. I have searched the forums and found nothing that could help me.

I want the system to automatically calculate the 'return date' depending on 'Loan Type' - there are 2 Loan Types:

- Standard - 14 days - used for books
- Audio/Video - 2 days - used for Audio/video Items

I have been trying to get the system to this for almost 4-5 hours now and can't get anywhere. The following is the expression i am using - DateAdd("y",[Date Out],[Loan Length]) - the DateOut field is calculated by placing date() as the default value for it in (tblLoans). That works fine. It is just the automatic calculation of the 'Return Date' field depending on Loan Type that is boggling the mind.
The idea is to bring the 'return date feature' into FrmLoans (form incharge for the loaning out of items) so that as items are being issued the system could calucalte the return date once 'LoanType' has been input.

It is urgent as the organisation whom i am freely donating it too, requires for it to be functional by next week. The second reason it is my A-level ICT Project.

I can provide the database upon request to any kind soul wishing to help me - one can reach me through e-mail as well : moonwingz@aol.com.

All help is welcome
Thank you for your help
 

C00ki3

New member
Local time
Today, 10:41
Joined
Nov 20, 2003
Messages
5
Library System Relationships

I am using Access 2002, attached are the relationships i am using.
You will see i have included tbl Loan Calculation -- this entity was established whilst i was struggling to figure out the 'Return date' feature and how i would do it.
 

Attachments

  • relationships.gif
    relationships.gif
    10.1 KB · Views: 135
R

Rich

Guest
DateAdd("y",[Date Out],[Loan Length]) should be
DateAdd("y",[Loan Length],[Date Out]) and you shouldn't store this vale in your table, it can be c\alculated at any time
 

C00ki3

New member
Local time
Today, 10:41
Joined
Nov 20, 2003
Messages
5
Hi Richard,

Many thanx for your reply,

I have tried the expression you have proposed, and i understand that you can use the calculation at any time i.e. via a form, with the same field headings.

But this does not solve my problem, part of the user requirements was that the system be as automated as possible, what would be ideal would be if this expression could work as the default value for the 'Return Date' field heading in table 'Loan Calcuation' (see relationships.gif)
But if i do that, and save the table, an error msg pops up saying "the database engine does not recognise either the field 'loan length' in a validation expression or the default value in the table 'loan calculation". (this is illogical as both field headings exist in the table loan calucation)
I understand that using a query and then the expression would work, but then i have problems implementing the query in the Form incharge for issueing items.

If you would kindly accept, i would be more than happy to send you a copy of the database. Please provide your e-mail address - thank you
 

neileg

AWF VIP
Local time
Today, 10:41
Joined
Dec 4, 2002
Messages
5,975
You don't place the calculation in the table, you put in in a query, or perhaps in a control on a form or report. Any place you can use a table, you can also use a query, so your query could look exactly the same as the table, except for the extra calculated field.
 

Users who are viewing this thread

Top Bottom