Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple way to put text in a date field?

Status
Not open for further replies.

conneticat

Programmer
Jul 16, 2004
47
US
Is there a simple way to have the option to put the date in a date field as well as have it default to something like "N/A" when the user enters N/A or something simple like 0 (but no other text).

I don't want to get too complicated, and I'd like to leave this field as a date field or a number. I tried an integer, formatted as something like: mm/dd/yyyy;mm/dd/yyyy;"N/A";"", thinking that the user could enter "0" and "N/A" would appear, but it just keeps wanting a date.
 
No can do. Looks like you'll have to add another field to your table.

There's one way to do this, but it's pretty universally regarded as a horrible idea: you could come up with dummy values to use in place of 0 and N/A, such as the first and send day storeable in an Access date field (which I can't remember, but the Help file probably can). But it really is a bad idea--you'll have to make all your queries handle these values, you'll have to make controls on your forms to insert and display these values. And your data won't be real.

I would just add a field to the table to indicate N/A, and update that field if the date is entered or deleted, and vice versa.

Jeremy

---
Jeremy Wallace
METRIX Lead Developer
Fund for the City of New York
http:// metrix . fcny . org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top