Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form Question

Status
Not open for further replies.

random75

Technical User
Apr 16, 2008
34
US
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....

Code:
=CalendarFor([DateProduced],"Select Production Date")
This is the public function...
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top