Adding "To be confirmed" where there is no date in field

amjad171

Registered User.
Local time
Today, 10:19
Joined
Nov 7, 2007
Messages
13
Hi,

Not sure if this is possible but is there a way in access for a date/time field to have the text "To be confirmed" if no date is entered.

I am creating a courses database and some courses do not have dates yet as they are looking for suitable venues.

Is this possible?
 
in a report yes - in a table - no

basically the code will be
if datedfield = null then
a field on report "To be confirmed "

reasoning behind this is a field is pre-formated so date field must have dates and number fields must have numbers ( so no letters)
 
I will be tring the following in ASP code and hat should work in my opinion:

<%
Dim i as Integer

For i = 1 To oRecordSet.RecordCount
If IsNull(oRecordSet!DateTimeColumnName) Then
Response.Write("To Be Confirmed")
Else
Response.Write(oRecordSet!DateTimeColumnName)
End If
Next i
 
Last edited:
Gary's point is that you can DISPLAY anything you want but you can only STORE a date.
 
As stated you cannot store text in a date field.
If you are only concerned with seeing "To Be Confirmed" on the form you could put a label next to the date field that displays TBC when the date is null (no need to store in db. Alternatively you could play around with laying a label over the top of the date field and switching focus and visiblility when TBC is clicked on.

Ant
 
Quicker, one-line way to set this:

YourDateField = Nz(YourDateField,"TBC")

Look up the Nz Function if that doesn't make sense.
 

Users who are viewing this thread

Back
Top Bottom