Not sure if possible but will ask.

jk12

Always getting problems.
Local time
Today, 11:52
Joined
Feb 16, 2006
Messages
91
Hi all i'm not sure if this can be done but if it can it would be really helpful. In my database there is a date field showing when a document has to be completed by which gets printed out in a report. However, some documents need to be assigned a return date of "ASAP". I thought about simpley changing the field to a text field, but then my report didn't order the dates correctly. I also considered trying some form of conditional formatting that showed blank date fields as "ASAP" on the report but wasn't sure if that would work either. Am I wasting my time trying to please people or is this possible?

To cut a long story short, is there is a way of getting "ASAP" to appear in a date field on a report or form?

Thanks for any comments/help
 
The answer is no and yes!!:D

You cannot put ASAP in the Date field but you can overlay the date field control with a Label containing ASAP and then switch visibility with code in the Report format event

The following example illustrates

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.datefield) Then
Me.datefield.Visible = False
Me.Labelasap.Visible = True
Else: Me.datefield.Visible = True
Me.Labelasap.Visible = False
End If
End Sub

Brian
 
Thanks works fine
 
No code needed

I know this is an old post, but another simpler solution is:
IIf(IsNull([Me.DateField]),"A.S.A.P.",[Me.DateField]) in the Expression Builder
;) lightray Access 2000
 
Well Lightray did you test that? I cannot get it to work. I did not expect to be able to put text into a date formatted control but gave it a try.

If I used [me.datefield] I was asked for the parameter me.datefield, if i ommitted the me. I had the field flagged as #error on the report.

Brian
 
Brianwarnock said:
Well Lightray did you test that?

There is no point posting things that don't work! I have been using this solution for many years.
lightray
 
Ok , since you're unable to suggest why my attemps fail I guess I'll have to investigate further by myself.

Brian
 
Last edited:
Sorry, wasn't focusing on that bit, and should have mentioned previously,
create an unbound text box for the equation.:D
 
Gotcha, but remember that you cannot sort on the field in the report and it is left justified, but if none of that matters it works a treat.

Brian
 
I suppose you could put the original in with visible = No if you still want to sort. And use the text Align to justify that!
lightray ;)
 

Users who are viewing this thread

Back
Top Bottom