I have a public function which opens a form and assigns the OpenArgs string to the title area on the form. I am wanting to use the tag property to identify each particular occurence of this form being opened. Can I add another argument to this public variable and somehow get it to populate the tag property of the form so I can reference it later. Right now the form is brought up with this line in the On_Click line of the form's property sheet....
This is the public function...
Code:
=CalendarFor([DateProduced],"Select Production Date")
Code:
Public Function CalendarFor(txt As TextBox, Optional strTitle As String)
'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, OpenArgs:=strTitle
Exit_Handler:
Exit Function
Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation, "CalendarFor()"
Resume Exit_Handler
End Function