Hey pbaldy,
Thanks for the response,
I found that page and i did read it but my coding is so bad I didnt really understand how to implement it.
Below is my macro converted to VBA using the access converter. I'm trying to do this so i can learn vba from what i know I made the macro with.
Pretty much i have 2 text boxes (StartDate and EndDate) and i want to know all the Claims in a report between those dates.
Im saying if there is no date, then show msg box, if no end date is used, then use today (using temp var as the end date parameter)
So where should i put the secnd lot of code to make this work correctly?
It is important to note that my system format is Australian (dd/mm/yyyy)
The tables are all working correctly as dd/mm/yyyy so its just a matter of getting the dates on the form correctly understood in the vba codes.
Code:
Function Macro1()On Error GoTo Macro1_Err
With CodeContextObject
If (IsNull(.StartDate)) Then
Beep
MsgBox "Please Enter Start Date", vbOKOnly, "No Date Entered"
End
End If
TempVars.Add "TempEndDate", .EndDate
If (IsNull(.EndDate)) Then
TempVars.Add "TempEndDate", Now()
End If
DoCmd.OpenReport "TotalPaymentsMade", acViewReport, "", Eval("""[ClaimDate] Between #"" & [StartDate] & ""#"" & "" AND #"" & [TempVars]![TempEndDate] & ""#"""), acNormal
End With
Macro1_Exit:
Exit Function
Macro1_Err:
MsgBox Error$
Resume Macro1_Exit
End Function
Code:
Format([Dates],"mm/dd/yy")