Using Win2k, Word 2k
I have a form i am try to display at a certain point in a document. I
thought a simple macro with
Sub show_frm ()
Myform.show
end sub
would cause the form to open, however i am getting an "object
required" object required error message. this same method works in
other templates i have. can anyone help
Thanks BRC
Charles Kenyon - 24 Apr 2006 00:39 GMT
Does MyForm exist in your template?
Better practice is to not use the show command but to create a new instance
of the form. The following is from a template which has a frmAddress that I
want to use:
Dim myForm As frmAddress
Set myForm = New frmAddress
myForm.Show
Unload myForm
Set myForm = Nothing

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Using Win2k, Word 2k
> I have a form i am try to display at a certain point in a document. I
[quoted text clipped - 6 lines]
> other templates i have. can anyone help
> Thanks BRC
Jezebel - 24 Apr 2006 01:01 GMT
Agree entirely. An even simpler way to code it is --
With New frmAddress
.Show
.Unload
End With
> Does MyForm exist in your template?
>
[quoted text clipped - 18 lines]
>> other templates i have. can anyone help
>> Thanks BRC
Charles Kenyon - 24 Apr 2006 03:23 GMT
Thank you for the tip.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> Agree entirely. An even simpler way to code it is --
>
[quoted text clipped - 25 lines]
>>> other templates i have. can anyone help
>>> Thanks BRC
Tony Jollans - 24 Apr 2006 08:23 GMT
Simple it might be. Correct it isn't.
--
Enjoy,
Tony
> Agree entirely. An even simpler way to code it is --
>
[quoted text clipped - 41 lines]
> >> other templates i have. can anyone help
> >> Thanks BRC
Jezebel - 24 Apr 2006 08:35 GMT
You're right. The unload shouldn't be there.
> Simple it might be. Correct it isn't.
>
[quoted text clipped - 47 lines]
>> >> other templates i have. can anyone help
>> >> Thanks BRC
Tony Jollans - 24 Apr 2006 10:04 GMT
Would that not leave an orphaned instance of the form in memory?
--
Enjoy,
Tony
> You're right. The unload shouldn't be there.
>
[quoted text clipped - 49 lines]
> >> >> other templates i have. can anyone help
> >> >> Thanks BRC
Jezebel - 24 Apr 2006 12:16 GMT
No. The form unloads automatically when the reference terminates.
> Would that not leave an orphaned instance of the form in memory?
>
[quoted text clipped - 56 lines]
>> >> >> other templates i have. can anyone help
>> >> >> Thanks BRC
Jezebel - 24 Apr 2006 00:41 GMT
The message means either that VBA doesn't know what "Myform" refers to, or
there is a bug in the form's initialisation code. a) Is the macro in the
same template as the form? b) What line is highlighted as throwing the
error?
> Using Win2k, Word 2k
> I have a form i am try to display at a certain point in a document. I
[quoted text clipped - 6 lines]
> other templates i have. can anyone help
> Thanks BRC
BRC - 24 Apr 2006 01:21 GMT
Thank you all, the problem was that the form was not in the same
template as the macro. It's displaying as it should. I used the code
that Charles outlined above. thanks again.
BRC