Hi - Is it possible to reference an established public variable in another module other than the one it was created in? In my database I have a main form page where the user selects a date from the calendar. The way that I have this set up is:
I would like to then be able to reference this variable "modeldate" in other modules but as it stands right now anytime I reference it, nothing appears which makes me think that I am doing something wrong with establishing the variable. Is there an easier way to do this or am I just missing something in the code I have right now?
Thanks!
Code:
Public modeldate As Date
'Model Date Select
Sub textModelDate_AfterUpdate()
Dim subseqDate As Date
'set modelDate equal to TextBox
modeldate = Me.textModelDate.Value
'check for month end date selected, if not then set modelDate to 0
subseqDate = DateAdd("d", 1, modeldate)
If Month(subseqDate) = Month(modeldate) Then
MsgBox "Please choose a month-end date for the Model Run Date."
modeldate = 0
End If
End Sub
I would like to then be able to reference this variable "modeldate" in other modules but as it stands right now anytime I reference it, nothing appears which makes me think that I am doing something wrong with establishing the variable. Is there an easier way to do this or am I just missing something in the code I have right now?
Thanks!