Hi,
I am using Allan Brownie Calendar for showing dates.
I added code:
Code:
Public gtxtCalTarget As TextBox 'Text box to return the date from the calendar to.
Public Function CalendarFor(txt As TextBox)
On Error GoTo Err_Handler
'Purpose: Open the calendar form, identifying the text box to return the date to.
'Arguments: txt = the text box to return the date to.
' strTitle = the caption for the calendar form (passed in OpenArgs).
Set gtxtCalTarget = txt
DoCmd.OpenForm "frmCalendar", windowmode:=acDialog
'' Form_frmCalendar.Tag = gtxtCalTarget
Exit_Handler:
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation, "CalendarFor()"
Resume Exit_Handler
End Function
I added this function into my textbox on form:
and now i want to pass public variable gtxtCalTarget into form in order to use it.
Code is working fine on the beginning but after opening the form public variable is not available within form vba code.
How can i solve it?
How can i pass gtxtCalTarget into my form?
Thank ou for helpping me,
Best wishes,
Jacek