-----Original Message-----
For that you could use the DLookup function. Suppose your queries
are named "qryFirstTradingDayOfMonth"
and "qryCurrentTradingDay", and they
return fields "FirstTradingDayOfMonth" and "CurrentTradingDay",
respectively. Then you could compare their results with:
If DLookup
("CurrentTradingDay", "qryCurrentTradingDay") = _
("FirstTradingDayOfMonth", "qryFirstTradingDayOfMonth") _
Then
' run the macro
Else
' don't.
End If
.
This is what I have done so far:
Public Sub StartOfMonth()
Dim stDocName As String
If DLookup([Last Trading Day], [Qry_Dates_upto_LTD]) = _
DLookup([First of Month],
[Qry_First_of_the_Month]) _
Then
DoCmd.RunMacro "Macro1"
End If
End Sub
________________________________
I get a Complie error: External name not defined.
[Last Trading Day] is highlighted.