Creating multiple userforms

D

drake

Hello. I am working in Word97 and learning VBA as I go about creating this
project. What I am trying to do is have a program where a user makes a
choice from a combo box or options buttons and, depending on their choice,
receives another specific userform. Then, based on their answers to those
questions, specific autotext would be entered into a specific place in their
document.
The places I am currently stuck are these -
1) How do I have another userform open after the user presses "OK" on the
first userform?
2) I plan to have the program started by the user pressing a button in their
menu bar. I know some of my code goes on the code form of the Userform.
Does some code need to go into a Module? If so, how do I determine which
code needs to go into the Module?

Thanks! Dragon
 
C

Charles Kenyon

Have you read the article "How to Create a UserForm" on the MVP FAQ site?
--
Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://www.addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://www.addbalance.com/usersguide/index.htm>

Word Resources Page
<URL: http://www.addbalance.com/word/wordwebresources.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
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.
 
W

Word Heretic

G'day "drake" <[email protected]>,

1)

Me.Hide
OtherForm.Show

2) Stick a PUBLIC SUB with NO parms in a CODE MODULE (Modules) to link
to your toolbar. This sub then does a UserForm.Show, ideally like this

Dim MyForm as WhateverTheFormNameIs
Set MyForm = New WhateverTheFormNameIs
Myform.Show
Set MyForm=Nothing




drake said:
Hello. I am working in Word97 and learning VBA as I go about creating this
project. What I am trying to do is have a program where a user makes a
choice from a combo box or options buttons and, depending on their choice,
receives another specific userform. Then, based on their answers to those
questions, specific autotext would be entered into a specific place in their
document.
The places I am currently stuck are these -
1) How do I have another userform open after the user presses "OK" on the
first userform?
2) I plan to have the program started by the user pressing a button in their
menu bar. I know some of my code goes on the code form of the Userform.
Does some code need to go into a Module? If so, how do I determine which
code needs to go into the Module?

Thanks! Dragon

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email: (e-mail address removed)
Products: http://www.geocities.com/word_heretic/products.html
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.
 
D

dragon

Thanks Steve.

For 1), that would be in the userform code and not the code module, right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top