date field format in entry form

J

Joe

I would like to format the date field on a data entry form so that the field
can accept a single date (03/01/2008) or a date span (03/01/2008 -
03/10/208). The single date format is a snap. The problem arises when no
date is entered in the span portion of the field. I do not know how to write
scripts or codes and this appears to be situation where a script or code
would solve the problem.

Any help will be greatly appreciated.

Thanks.
 
D

Douglas J. Steele

Assuming you're using a Date data type field, it cannot be done. The Date
data type is intended to hold a single timestamp: under the covers, it's an
8 byte floating point number, where the integer portion represents the date
as the number of days relative to 30 Dec, 1899, and the decimal portion
represents the time as a fraction of a day.

While it can be done using a Text data type field, I'd strongly recommend
against do it. Have two separate fields: a StartDate and an EndDate, with
the EndDate set either to Null or to the same as StartDate when it's a
single date.
 
J

Joe

Thanks Doug,

I was thinking of a magical solution but the start and end date solution
will solve the problem

Have a good day!
 
R

Richard Rost

I agree with Doug, the two fields are best. HOWEVER, if you want to get
froggy and you want to impress people, you could put it in a single box and
then programmatically separate both dates into two hidden date fields.

But that's only if you want to get fancy. I think most users are perfectly
happy with two date fields.


I hope this helps you. Let me know if you have any more questions or
comments.

Cordially,

Richard Rost
www.599CD.com
www.AccessLearningZone.com

P.S. Visit my web site and watch my 90-minute ACCESS 101 TUTORIAL for free.
Go to www.599cd.com/Access/NG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top