G
Guest
I have a standalone module (i.e. not behind a form) that has these two
variables (among many others) in its declarations section:
Option Explicit
Public Date1 As Date
Public Boolean1 As Boolean
(Not their real names, obviously.) I set the value of these variables in a
Public Function within that module, like this:
Public Function TestFunction()
Date1 = Date
Boolean1 = True
End Function
When I call the function from a sub on a form, Boolean1 returns True, but
Date1 returns Null. Why?
Private Sub Test()
TestFunction
MsgBox Boolean1 'returns "True"
MsgBox Nz (Date1,"Null") 'returns N'"Null"
End Sub
variables (among many others) in its declarations section:
Option Explicit
Public Date1 As Date
Public Boolean1 As Boolean
(Not their real names, obviously.) I set the value of these variables in a
Public Function within that module, like this:
Public Function TestFunction()
Date1 = Date
Boolean1 = True
End Function
When I call the function from a sub on a form, Boolean1 returns True, but
Date1 returns Null. Why?
Private Sub Test()
TestFunction
MsgBox Boolean1 'returns "True"
MsgBox Nz (Date1,"Null") 'returns N'"Null"
End Sub