Solved Adding Time to current time and date

theinviter

Registered User.
Local time
, 20:13
Joined
Aug 14, 2014
Messages
273
Dear guys;

I have a problem need help please ,
i have following field :
Time = Format(Now(), "short time")
BUD_Time = (Time entered by user in hours)
exp_date = Date
Item= product name

so i want when user double click on exp_date then do following action:

Private Sub exp_date_DblClick(Cancel As Integer)
exp_date = Date + BUD
time = Format(Now(), "short time")

Else

exp_date = Date
time = Format(Now(), "short time") + BUD_Time
due_date = Date
[time 1] = Format(Now(), "short time")
End If


I got this Error with Highlighted code " Type mismatch" .

so i want upon double click the time (now) added to BUD_Time entered by user to show in field Time. and if result exceed 24 hours then update exp_date to next date.
 
Hi. Assuming BUD_Time is a date/time datatype, try it this way:
Code:
time = Format(Now() + BUD_Time, "short time")
PS. "time" is a reserved word in Access. You might consider using another name for your field.
 
Hi. Assuming BUD_Time is a date/time datatype, try it this way:
Code:
time = Format(Now() + BUD_Time, "short time")
PS. "time" is a reserved word in Access. You might consider using another name for your field.
thanks alot
work good

but if result exceed 24 hours then update exp_date to next date.
how to do this
 
thanks alot
work good

but if result exceed 24 hours then update exp_date to next date.
how to do this
What do you mean by "exceed 24 hours?" Are you saying past midnight today?
 

Users who are viewing this thread

Back
Top Bottom