Again, too many quotes:
Try:
Code:
DLookup("[amount]", "data", "[mth_year] = " & SQLDate(MTH) & " And [vch_no] = '" & VCHNO & "' And [alloc] = '003456'")
I did not test this, but try
Function:
Code:
Function SQLDate(ByRef pvarVdt As Variant) As String
On Error GoTo Err_SQLDate
'default return date so a NULL is not returned
SQLDate = "#1/1/1900#"
If IsDate(pvarVdt) Then
SQLDate = "#" & Format(pvarVdt, "mm/dd/yyyy") & "#"
End If
Exit_SQLDate:
' On Error Resume Next
Exit Function
Err_SQLDate:
MsgBox Err.Description, vbCritical, "Module" & ": " & "SQLDate"
Resume Exit_SQLDate
End Function