Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Mixing imput masks

Question posted by: JTD927 (Newbie) on July 24th, 2008 05:30 PM
I am working with Access 2003. I have aclient who would like to have a field where the user can enter either a date or "N/A". I know how to do an input mask for either one but not both. Is there code I can write to to accomplish this? I know how to do the code for "N/A" but how do I add in the date part of it?

Thank you!

Troy
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
PianoMan64's Avatar
PianoMan64
Expert
265 Posts
July 25th, 2008
06:12 AM
#2

Re: Mixing imput masks
The String Value N/A is not supported in the Date/Time Field. If the value of the field is Null, you can have a conditional statement that can have the control on the form display N/A, but you can't store that value in the Table.

Example:

Code: ( text )
  1. =IIF(IsNull([BlankDateFieldControl]),"N/A",[DateField]))


You check the control on the form "BlankDateFieldControl" and see if it is Null, and if it is, then display N/A on loosing focus or whatever event would accommodate what you're trying to do.

Reply
Reply
Not the answer you were looking for? Post your question . . .
184,182 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft Access / VBA Forum Contributors