Now I'm confused. "I have a field that currently holds the form that's
open" - I assume this field is the data for a textbox in a hidden form, or
at least a form that is always open - which I referred to as
"AlwaysOpenForm"
"I'm trying to create a module that will keep me from having to type that
code repeatedly." I'm not sure I understand what you mean now by 'that
code'. I thought you meant code that would close and open the form, while
keeping track of the current form.
"then I would also like to SetFocus on the field that was originally double
clicked from on that original form." - this is really throwing me. Usually
you click on a button to open a form, but hey, I see that you want to click
on the name of a form, stored in a textbox. But maybe not, since you then
want to move the focus back to the same field ...?
"When the form is open in edit mode, in code I would like to be able to get
the name of the form, so that I don't have to change the module on each
form?"
Perhaps if you used 'Form A', 'Form B', this would be more clear. Perhaps I
just don't get the real purpose here. What module are you talking about
changing? Please, if you explain it slowly for me, I know I can understand,
but at this point, I'm lost as to what it is you really want to accomplish.
Darryl Kerkeslager
(via EMail)
Darrel,
Thank you for your post, but I'm not sure I understand what you're saying.
I have a field that currently holds the form that's open. I'm trying to
create a >module that will keep me from having to type that code repeatedly.
Dim frm as form
frm = fldFormsHolder
DoCmd.OpenForm frm
then I would also like to SetFocus on the field that was originally double
clicked from on that original form.
When the form is open in edit mode, in code I would like to be able to get
the name of the form, so that I don't have to change the module on each
form?
Michael
"Darryl Kerkeslager" <Ke*********@comcast.net> wrote: If that form is open all the time, then create a public sub of that form
to set the name, then call it from your form:
In AlwaysOpenForm:
Public Sub SetVisibleForm(fromName As String)
Me.txtVisibleForm = formName
End Sub
In the code for 'Open' buttons for your other forms:
DoCmd.Close acForm, Me.Name
AlwaysOpenForm.SetVisibleForm "NewForm"
DoCmd.OpenForm "NewForm"
Darryl Kerkeslager