If you don't want to include the Call statement, just use Calculate
#7/1/2003#, #7/31/2003#
From the Access97 help file - Call Statement
"You are not required to use the Call keyword when calling a procedure.
However, if you use the Call keyword to call a procedure that requires
arguments, argumentlist must be enclosed in parentheses. If you omit the
Call keyword, you also must omit the parentheses around argumentlist. If you
use either Call syntax to call any intrinsic or user-defined function, the
function's return value is discarded."
Mike Storr
www.veraccess.com
"neptune" <bs**********@hotmail.com> wrote in message
news:c5**************************@posting.google.c om...
I have limited knowledge of VBA, but I've learned a lot here. I
can't figure out how to pass 2 parameters in a sub? I call PassDate
and pass 1 date.
Public Sub PassDate()
Calculate (#7/1/2003#)
End Sub
Public Sub Calculate(var1 As Date)
'Runs Code
End Sub
Then I try:
Public Sub PassDate()
Calculate (#7/1/2003#, #7/31/2003#)
End Sub
Public Sub Calculate(var1 As Date, var2 As Date)
'Runs Code
End Sub
The "Calculate (#7/1/2003#, #7/31/2003#)" expression errors and asks
for an equal sign. How would I pass 2 parameters to another function?
Thanks.