Date/Time property and arguments

jGURU

New member
Local time
Today, 21:38
Joined
May 2, 2003
Messages
9
Ok, what i am basically trying to do is say insert the current date in the curDate field (done that), then i am trying to say, in the dueDate field, make the default value next day by 9 pm. How can i add it to the current time. What kind of arguments do Date() and Time() accept?

I have also tried to do this in a query and then create a form with no success. I would really appreciate any help.

I am working on a college project for a library if its any help.
 
See Help for the "DateAdd" function. That will let you add 1 day to the current date.

Also see Help for "DatePart". I think you will need to use DateAdd to advance to the next date. Then you will need to set a Date variable to Year, Month, Day, Hours, Minutes, Seconds.

RichM
 
jGURU,

To add another perspective to Rich's suggestion:

Scenario: You have two textboxes on a form, txtNow and Txtlater, as well as a command button. Type a date into txtNow and click the command button, invoking this code which you must put in the button's click event to fill txtLater.

Code:
'Set a variable in RAM
    Dim dblFraction As double

'9:00 pm is the 21st hour of 24 hours
    dblFraction = 21 / 24

'days are stored as integers; add 1 day
    Me.txtLater = Me.TxtNow + 1

'now add 21 hours, a fraction of 1 day
    Me.txtLater = Me.txtLater + dblFraction

Play with it and you'll get it in no time.

Regards,
Tim
 
Last edited:

Users who are viewing this thread

Back
Top Bottom