ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question on User Forms and Command Buttons (https://www.excelbanter.com/excel-programming/402094-question-user-forms-command-buttons.html)

TotallyConfused

Question on User Forms and Command Buttons
 
First time working on User Form. I have created a Main form and 3 additional
forms. I want to keep this as simple as possible. My main form consists of
3 command buttons enabling user to click and go to a specific form. I also
have an exit button. However, I want to give the user a chance to cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I woud like
the user to return to the main screen and submit and the form to be able to
add all the data to the db worksheet. Is this possible all at once or is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.

carlo

Question on User Forms and Command Buttons
 
You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3 additional
forms. I want to keep this as simple as possible. My main form consists of
3 command buttons enabling user to click and go to a specific form. I also
have an exit button. However, I want to give the user a chance to cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I woud like
the user to return to the main screen and submit and the form to be able to
add all the data to the db worksheet. Is this possible all at once or is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.



TotallyConfused

Question on User Forms and Command Buttons
 
Hi thank you for responding. What do you mean add a page control? I am
sorry but this is the first time working with User Forms. Reason for
creating 3 different forms, is for the form not to be too busy for the user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3 additional
forms. I want to keep this as simple as possible. My main form consists of
3 command buttons enabling user to click and go to a specific form. I also
have an exit button. However, I want to give the user a chance to cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I woud like
the user to return to the main screen and submit and the form to be able to
add all the data to the db worksheet. Is this possible all at once or is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.




Bob Phillips

Question on User Forms and Command Buttons
 
He means the multipage control, the one in the toolbox that looks like a
tabbed image that you often see in dialogues.

The form would not be too busy, as the user would only see one page of the
multipgae at a time, although you would need to validate that they have
processed all pages.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"TotallyConfused" wrote in
message ...
Hi thank you for responding. What do you mean add a page control? I am
sorry but this is the first time working with User Forms. Reason for
creating 3 different forms, is for the form not to be too busy for the
user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3
additional
forms. I want to keep this as simple as possible. My main form
consists of
3 command buttons enabling user to click and go to a specific form. I
also
have an exit button. However, I want to give the user a chance to
cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I woud
like
the user to return to the main screen and submit and the form to be
able to
add all the data to the db worksheet. Is this possible all at once or
is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.






TotallyConfused

Question on User Forms and Command Buttons
 
Okay I get it. How would I validate on a multipage? Could I apply the same
validation having 3 forms? Thank you.

"Bob Phillips" wrote:

He means the multipage control, the one in the toolbox that looks like a
tabbed image that you often see in dialogues.

The form would not be too busy, as the user would only see one page of the
multipgae at a time, although you would need to validate that they have
processed all pages.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"TotallyConfused" wrote in
message ...
Hi thank you for responding. What do you mean add a page control? I am
sorry but this is the first time working with User Forms. Reason for
creating 3 different forms, is for the form not to be too busy for the
user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3
additional
forms. I want to keep this as simple as possible. My main form
consists of
3 command buttons enabling user to click and go to a specific form. I
also
have an exit button. However, I want to give the user a chance to
cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I woud
like
the user to return to the main screen and submit and the form to be
able to
add all the data to the db worksheet. Is this possible all at once or
is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.






Bob Phillips

Question on User Forms and Command Buttons
 
Yes, of course. You have two options, validate each page as you leave it, or
have an OK button and validate them all from there.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"TotallyConfused" wrote in
message ...
Okay I get it. How would I validate on a multipage? Could I apply the
same
validation having 3 forms? Thank you.

"Bob Phillips" wrote:

He means the multipage control, the one in the toolbox that looks like a
tabbed image that you often see in dialogues.

The form would not be too busy, as the user would only see one page of
the
multipgae at a time, although you would need to validate that they have
processed all pages.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"TotallyConfused" wrote in
message ...
Hi thank you for responding. What do you mean add a page control? I
am
sorry but this is the first time working with User Forms. Reason for
creating 3 different forms, is for the form not to be too busy for the
user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3
additional
forms. I want to keep this as simple as possible. My main form
consists of
3 command buttons enabling user to click and go to a specific form.
I
also
have an exit button. However, I want to give the user a chance to
cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I
woud
like
the user to return to the main screen and submit and the form to be
able to
add all the data to the db worksheet. Is this possible all at once
or
is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.








TotallyConfused

Question on User Forms and Command Buttons
 
Thank you but how do I validate all pages on main screen? Could you provide
me a small sample? I imagine it would be with a "command button" named
"submit".

"Bob Phillips" wrote:

Yes, of course. You have two options, validate each page as you leave it, or
have an OK button and validate them all from there.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"TotallyConfused" wrote in
message ...
Okay I get it. How would I validate on a multipage? Could I apply the
same
validation having 3 forms? Thank you.

"Bob Phillips" wrote:

He means the multipage control, the one in the toolbox that looks like a
tabbed image that you often see in dialogues.

The form would not be too busy, as the user would only see one page of
the
multipgae at a time, although you would need to validate that they have
processed all pages.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"TotallyConfused" wrote in
message ...
Hi thank you for responding. What do you mean add a page control? I
am
sorry but this is the first time working with User Forms. Reason for
creating 3 different forms, is for the form not to be too busy for the
user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3 different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and 3
additional
forms. I want to keep this as simple as possible. My main form
consists of
3 command buttons enabling user to click and go to a specific form.
I
also
have an exit button. However, I want to give the user a chance to
cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled I
woud
like
the user to return to the main screen and submit and the form to be
able to
add all the data to the db worksheet. Is this possible all at once
or
is it
better to go from each form and submit data from each single form?

Any help will be greatly appreciated. Thank you.









Bob Phillips

Question on User Forms and Command Buttons
 
You can validate the textboxes etc just the same as if they were all on a
single form,you do not need to reference them through the multipage control.



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"TotallyConfused" wrote in
message ...
Thank you but how do I validate all pages on main screen? Could you
provide
me a small sample? I imagine it would be with a "command button" named
"submit".

"Bob Phillips" wrote:

Yes, of course. You have two options, validate each page as you leave it,
or
have an OK button and validate them all from there.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"TotallyConfused" wrote in
message ...
Okay I get it. How would I validate on a multipage? Could I apply the
same
validation having 3 forms? Thank you.

"Bob Phillips" wrote:

He means the multipage control, the one in the toolbox that looks like
a
tabbed image that you often see in dialogues.

The form would not be too busy, as the user would only see one page of
the
multipgae at a time, although you would need to validate that they
have
processed all pages.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"TotallyConfused" wrote in
message ...
Hi thank you for responding. What do you mean add a page control?
I
am
sorry but this is the first time working with User Forms. Reason
for
creating 3 different forms, is for the form not to be too busy for
the
user.
Would I get the same effect with page control? Thank you.

"carlo" wrote:

You mean, if the user presses the exit button, he should be asked
if
he really wants to leave??

----------------------------------------
private sub MyExitButton_click()

if msgbox("do you want to go", VbOkCancel, "Leave??") = vbok then
'whatever you want to do
unload me 'closes the form
me.hide 'hides the form
activeworkbook.close 'closes the workbook
end if

end sub
----------------------------------------

If you hide the forms (see above) they are still accessible with
myform1.mytextfield.
If you unload them, the data in the fields is lost.

it should be possible, but I never did it. You could add a page
control on your main form, then you wouldn't need to have 3
different
forms!

hth

Carlo

On Dec 3, 2:25 pm, TotallyConfused
wrote:
First time working on User Form. I have created a Main form and
3
additional
forms. I want to keep this as simple as possible. My main form
consists of
3 command buttons enabling user to click and go to a specific
form.
I
also
have an exit button. However, I want to give the user a chance
to
cancel
before exiting. How do I do this?

I also have another question once all the forms have been filled
I
woud
like
the user to return to the main screen and submit and the form to
be
able to
add all the data to the db worksheet. Is this possible all at
once
or
is it
better to go from each form and submit data from each single
form?

Any help will be greatly appreciated. Thank you.












All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com