Enter "N/A" in a date field

  • Thread starter Thread starter Mac
  • Start date Start date
M

Mac

I have a form set up with date fields for various tasks on
a checklist. I've set the date fields up with a pop-up
calendar. Is there an easy way to keep this format but
also allow for text (such as N/A) to be entered when dates
don't apply?

Thanks
Mac
 
You can set the format property of a text box to display N/A if the value is
null. For instance the format property could be set to:
Format: dd-mmm-yyyy;"";"";"N/A"
 
Put the following code where you open the form with the pop-up calendar control:
DoCmd.OpenForm "NameOfCalendarForm",,,,,acDialog
If <<Some condition >> Then
Me!NameOfTextBox = Forms!NameOfCalendarForm!CalendarName.Value
Else
Me!NameOfTextBox = "N/A"
End If
DoCmd.Close acForm, "NameOfCalendarForm"

Put the following code in the AfterUpdate event of the calendar control:
Me.Visible = False
 
Back
Top