conditional formatting for date field - text or date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,
I have a date field that I would like to display as a text value if it
equals a certain value, so that when I see the value on my form, it comes out
formatted correctly.
How can I format a field for a date and allow it to handle text values too?
Is that not possible?
I can't display date and text values for the same text box. Here's what I am
doing:

if (me.dateINput = '01/01/2007' ) then
myform!textdate = "beginning "
else
myform!textdate = me.dateInput
end if
 
trevi,
I think your headed for some problems using this scheme. A field can beither a Date OR
Text... not both.
You can make the field a Text field, but any date values entered in there will have to
be converted from string to date when doing any date calculations, sorting, etc... etc...
Better to make the field a Date/Time field (ex. MyDate), and only enter legitimate
dates in there. An unbound calculated field next to the date field....
= IIF(MyDate = #1/1/2007#, "Beginning", "")
will always display "Beginning" if the MyDate is 1/1/2007.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
You're right, I agree. Thanks.

Al Campagna said:
trevi,
I think your headed for some problems using this scheme. A field can beither a Date OR
Text... not both.
You can make the field a Text field, but any date values entered in there will have to
be converted from string to date when doing any date calculations, sorting, etc... etc...
Better to make the field a Date/Time field (ex. MyDate), and only enter legitimate
dates in there. An unbound calculated field next to the date field....
= IIF(MyDate = #1/1/2007#, "Beginning", "")
will always display "Beginning" if the MyDate is 1/1/2007.

--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 

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

Back
Top