Default text in date field

  • Thread starter Thread starter mogll
  • Start date Start date
M

mogll

Is it possible to display default text "DRAFT" in bold red in a date field
until such time the date is entered and displays in another color? I want to
be able to issue a draft report and looking for a simple way to do it.
 
One way is to set the format of the control to display "DRAFT" in red.
However you also want bolding.
Control's Format: mm/dd/yyyy;"DRAFT"

Now use CONDITIONAL formatting to control the formatting in addition to
control's format to force the "DRAFT"

--Click on the control
--Select Conditional formatting from the Format menu
--Select Red and Bold from the formatting options
--Select Expression is From the Condition Drop down
--Enter [NameOfDateField] is Null

That should work. I can't test it right now.



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Thank you. I tried the format setting and didn't work. I tried both table &
report format fields. Also failed to mention I'm running ver. 2002; don't
have conditional formatting option.

John Spencer said:
One way is to set the format of the control to display "DRAFT" in red.
However you also want bolding.
Control's Format: mm/dd/yyyy;"DRAFT"

Now use CONDITIONAL formatting to control the formatting in addition to
control's format to force the "DRAFT"

--Click on the control
--Select Conditional formatting from the Format menu
--Select Red and Bold from the formatting options
--Select Expression is From the Condition Drop down
--Enter [NameOfDateField] is Null

That should work. I can't test it right now.



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Is it possible to display default text "DRAFT" in bold red in a date field
until such time the date is entered and displays in another color? I want to
be able to issue a draft report and looking for a simple way to do it.
 
You don't set the format in the table, you set it on the control in the
report. And I made an error, the format should be

mm/dd/yyyy;mm/dd/yyyy;mm/dd/yyyy;"DRAFT"[Red]

that should return DRAFT when the field is null

You will have to use VBA code to control the bolding.

In the format event of the section holding the date, you will need something like:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.txtDateControl.FontBold = IsNull(Me.txtDateControl)
End sub

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Thank you. I tried the format setting and didn't work. I tried both table &
report format fields. Also failed to mention I'm running ver. 2002; don't
have conditional formatting option.

John Spencer said:
One way is to set the format of the control to display "DRAFT" in red.
However you also want bolding.
Control's Format: mm/dd/yyyy;"DRAFT"

Now use CONDITIONAL formatting to control the formatting in addition to
control's format to force the "DRAFT"

--Click on the control
--Select Conditional formatting from the Format menu
--Select Red and Bold from the formatting options
--Select Expression is From the Condition Drop down
--Enter [NameOfDateField] is Null

That should work. I can't test it right now.



John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Is it possible to display default text "DRAFT" in bold red in a date field
until such time the date is entered and displays in another color? I want to
be able to issue a draft report and looking for a simple way to do it.
 
Back
Top