amjad171
01-17-2008, 01:44 AM
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?
GaryPanic
01-17-2008, 02:14 AM
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)
amjad171
01-17-2008, 02:18 AM
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
Pat Hartman
01-17-2008, 02:35 PM
Gary's point is that you can DISPLAY anything you want but you can only STORE a date.
anthonys
01-18-2008, 12:53 AM
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
Moniker
01-18-2008, 05:39 AM
Quicker, one-line way to set this:
YourDateField = Nz(YourDateField,"TBC")
Look up the Nz Function if that doesn't make sense.