By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Date Time Data Entry

P: 1
I have a database with 2 date/time fields, [DueDate] and [CompleteDate].
I am looking for a way to make the fields on a form act as two seperate fields, one for the date and a second for the time. I have tried having two separate text fields linked to the same date/time field, with one formatted as a date and one formatted as a time, but this has not worked properly.
I cannot modify the existing fields, but I can add additional fields if necessary.
Any thoughts would be greatly appreciated.
Feb 11 '10 #1
Share this Question
Share on Google+
2 Replies

P: 109
I'm just thinking out loud here and am by no means an expert but couldn't you do something like the following:
For DueDate, have that on your form...
Then two text boxes, txtDate and txtTime. Format txtDate to Short Date and txtTime to Long Time.
Change both of their AfterUpdate events to something like
Expand|Select|Wrap|Line Numbers
  1. Me!DueDate.Value = Me!txtDate & " " & Me!txtTime
And it should add the correct information to the DueDate textbox. In theory anyway.
There's almost definitely a better way to do this and I'm not sure if that will bring about an error but it might be worth playing around with something like that

I'm sure an actual expert will wade in and come up with a better solution now!
Feb 12 '10 #2

Expert 2.5K+
P: 3,072
Besides setting the DateTime field after an update as described by hedges98, you'll also need to fill the fields in the form's OnCurrent event.
Personally I would place the (bound) DateTime field on the form but set the visibility to "No".

Feb 14 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.