Asking a question when form loads

M

mrodwell

Hi there,
I have a problem i have a document which the users have to enter the
details through VBA forms that load. I would like it to FIRSTLY....ask
a question when the form loads then depending on the answer do a
certain thin like yes then allow access to the form to enter details
or No to pass onto the next form.
SECONDLY....i would like another question to be asked when the form is
complete so if its Yes then the vba form is reset and on the document
it goes to the next line down. then No continues the code onto the
next vba box.

please help.

Mat
 
H

Harold

You can use something like this placed in event that starts your process:
Dim x As Integer
x = InputBox("Enter either 1 or 2 to continue! ", "Title")
If x = 1 Then
UserForm1.Show
ElseIf x = 2 Then
UserForm2.Show
Else
MsgBox "Please enter 1 or 2!"

End If

You can add a button to each form that prompts the user if they are
finished.
The button can display a messagebox with a Yes/No/Cancel. Then you can
capture what the user clicked to determine how to proceed.
 

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