You can do this in your underlying query by using a calculated field. Use the IIF to determine if the data is there or not and either return the field value or the formatted date. Use this calculated field as the record source for your your control.
Here's a simple example...
Table3 has two numeric fields [F1] and [F2].
[F1] is required and primary key
[F2] is allowed to be null.
You could make them date fields.
A simple select query that returns all of the records for [F1][F2] and calculated field [z_return0]; however, if [F2] is null then it returns a numeric zero in the field [z_return0]
- SELECT Table3.f1,
-
Table3.f2,
-
IIf(IsNull([f2]),0,[f2]) AS z_return0
-
FROM Table3;
You can return a formatted date or what ever...
No VBA code to write and will work if the code is disabled.
-z
-z