Since you are stuck with the structure, you can use a function to get the
maximum across the row. I've posted on example below.
In a query, you would add a calculated field
Field: MaxDate: fRowMax([Appt 1],[Appt 2],[Appt 3],[Appt 4])
Add the following code to a VBA Module and save the module with a name other
than fRowMax (perhaps mod_SpecialFunctions)
'------------- Code Starts --------------
'Version to handle dates, numbers, or text values
Public Function fGetRowMax(ParamArray Values()) As Variant
'John Spencer UMBC CHPDM
'Last Update: April 5, 2000
'Returns the Maximum of a group of values passed to it.
'Sample call:
' fGetRowMax("-21","TEST","2", "3","4","5","6","7",0) returns "TEST"
' fGetRowMax(-21,2,3,4,5,6,7,0) returns 7
'Handles text, date, & number fields.
Dim i As Long, vMax As Variant
vMax = Null
For i = LBound(Values) To UBound(Values)
If IsNull(Values(i)) = False Then
If Values(i) <= vMax Then
Else
vMax = Values(i)
End If
End If
Next
fGetRowMax = vMax
End Function
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County