Adding to a date field query

dwayne dibley

Registered User.
Local time
Today, 01:31
Joined
Oct 1, 2008
Messages
26
This problem has become the bain of my life, I just cant find a way to resolve it - it should be so bloody simple.

Basically what should happen is; the user inputs the library book ascension number which returns all the data of the book included the amount time the book is allowed to be loaned(7,14,21 days). I have another field called loaned date(which I have used the now function). I then have another unbound text field which I have called due date and all I want tje form to do is add the maxloantime to today's date - resulting in due date.

I have tried the dateadd function, simply adding them together, afterupate on numerous fields but I dont get a fucking sausage - the field simply stays blank.

I had this prob a few weeks back which I thought had been resolved, but no its back again.

HELP!!!!
 
It should be as simple as:

Me.DueDateField = DateAdd("d", Me.AmountOfDaysField, Me.LoanedDate)

in the appropriate event.
 
It should be as simple as:

Me.DueDateField = DateAdd("d", Me.AmountOfDaysField, Me.LoanedDate)

in the appropriate event.

That's what I have tried.

I have added to the 'after update' event in the ascension number field and this is how it shows:-

=[Due Date]=DateAdd([d],[Loan_type],[Loan_date])

I currently get this error message:-

The expression after update you entered as the event property seting produced the following error:the object doesnt contact the automationobject 'd'..
 
The 2 equals signs are a problem. Is that in the VBA editor or right in the properties panel?
 
The 2 equals signs are a problem. Is that in the VBA editor or right in the properties panel?

In the properties and thats something I have tried to remove, but when I access the properties again the equals sign has re-appeared.
 
Delete that in the properties window and type in [Event procedure], then click on the ellipsis to the right (...). That should take you to the code window, where you can input the code I suggested earlier.
 
I have feeling it has nothing to do with the code but the duedate(unbound) field. I tested the duedate field with the now function and the field stays blank.
 
Also I believe the Interval needs to be "d" not [d]. You may also want to use the Date() function rather than Now() to generate your loaned date, if you're going to be comparing these dates to the current date at any point.
 

Users who are viewing this thread

Back
Top Bottom