Avatar of mlcktmguy
mlcktmguy
Flag for United States of America asked on

Combine Short Date field and Short Time Field into One Date/Time Field

The user in my application need to record the Date and Time of an event on a form.  They asked that the two fields be split into an EventDate(Short Date) and EventTime(shortTime) fields.  They feel it is easier to enter them individually.  The date is entered as short date (12/23/14) and the time is entered as short time (13:24).  When I store the records I want to store a combined date and time.  How do I ocmbine these two individual fields into one consolidated Date/Time

The form:

Event Date
Event Time
Microsoft Access

Avatar of undefined
Last Comment
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015

8/22/2022 - Mon
IrogSinta

Try using
EventDateTime = EventDate & " " & EventTime
ASKER CERTIFIED SOLUTION
Patrick Matthews

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
IrogSinta

What matthewspatrick said is even simpler:
EventDateTime = EventDate + EventTime
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015

If the text boxes are set to have the format as date and time the the data type should be correct and you can simply add them together

If that does not work then try wrapping with CVDate().

Example:
? CVDate("12/31/2012") + CVDate("13:24")
12/31/2012 1:24:00 PM 

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck