William Thompson
william.thompson1 at att.net
Fri Nov 19 09:24:08 CST 2004
Hi,
I have a SQL Server front-end that has to be a minimal code solution, and I
wanted to open a form, form_someform, with openargs "Edit" or "Add".
I don't want the user to have to 'x' out to close the form instance. There
would only be the two additional instances.
My question is how to handle the close button in the new instance. Am I
correct to presume that I have to pass the new instance a reference to
itself in order to hand control back to the caller?
The call to open the instance would be something like
Dim frmSomeTable As Form_SomeTable
Set frmSomeTable = New Form_SomeTable
Form_SomeTable.Setfocus
Set Form_SomeTable = Nothing
''' I think the new instance needs a Method like
public sub InstanceIt(TheCaller as form)
Set m_frmThis = Me
Set m_frmCaller = TheCaller
Me.Visible = True
end sub
''' So eventually I'd like to somehow have a command button that closes the
form sort of like..
Private Sub cmdCloseThis()
''' Set m_frmThis = Nothing
''' Or I guess it has to be
''' HandItBackToTheCaller
me.Hide
m_frmCaller.SetFocus
End Sub
''' Caller's Code continued ...
Set Form_SomeTable = Nothing
This won't work though will it ? I'm a little fuzzy on it, any help
appreciated.
Bill