Need help in a very simple calculation!! PLZZ Urgent

3lami

New member
Local time
Today, 05:15
Joined
Feb 29, 2012
Messages
2
i am implementing a car rental management system

in a check-in form:

i want that once i choose the duration of rental (in days) it adds that number (as days) to the date_of_rental (which has a default value of todays date) and display the result in the date_of_return


i used the following code in the : After update event:

Code:
Me.date_of_return = DateAdd("dd", Me.duration, Me.date_of_rental)

but it tells me :

run-time error '5' :
invalid procedure call or argument

please give me the solution


thanx
 
try it with one "d"

Code:
Me.date_of_return = DateAdd("d", Me.duration, Me.date_of_rental)
 
Try using a single "d" in the function parameters.
You also need to have a numeric value for the interval and a date value for the date (as opposed to strings), so you need to enforce the data types if the controls return text.
 
thank you BROs

it worked with a single d

i appreciate your help
 

Users who are viewing this thread

Back
Top Bottom