I have several forms which I need to pass criteria to when opening.
Rather than using the docmd.... I have a function in the form which I call and this results in the form opening.
Doing this lets me pass multiple criteria to the form when it opens.
The code in the form is like...
Form_frm_Email.fnc_SetUpForm SetForm_Title:="Email To Landord: " & Me.Lan_1_Name_Long, _
SetAddress_To:=Me.Lan_1_Email, _ etc...
To Open the form from another using a button I use:
Public Sub fnc_SetUpForm(ByVal SetAddress_To As Variant, _
Optional ByVal SetAddress_CC As Variant = Null etc....
This all works fine, BUT I have the following problem...
When opening the form (although it is set as Modal and Popup), the code from the open button continues to execute, rather than halting when the form opens.
I also note that when the form is opened by using the function, there is no design view avaiable (although if i just open the form norally design view is avalable).
I would very much appreciate thoughts about what is different when the form is opened through a function and also if there is away I can get the code to stop running on opening, but still retain the method of opening the form by calling the funstcion.
Many thanks Mark