UserForm, a Multipage and printing...

G

Guest

I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm, I
have a MultiPage with 9 tabs. They all contain more information than can be
displayed on the UserForm. I would like to be able to have the print button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from a
SPECIFIED page into a sheet and make that print. However, I don't know how to
detect the 'activepage'.

Can anyone help? Thanks in advance!
 
N

Norman Jones

Hi IY_Roofer,

The MultiPage's Value property returns the page - the
first page is 0
 
G

Guest

Norman and Peter... you two solved a good portion of my problem and I thank
you both.

How about being able to set that value and applying it to a print function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '==> Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code]) to
get it into a Sheet for printing or is there another method of, like a do or
while statement, that can perform such a proceedure?
 
B

Bob Phillips

Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

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

IT_roofer said:
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '==> Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code])
to
get it into a Sheet for printing or is there another method of, like a do
or
while statement, that can perform such a proceedure?


IT_roofer said:
I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!
 
G

Guest

That's what I mean - how do I dump the data? "If ActivePage = 0 then" and
then write the code to fill cells with captions and values and repeat with
"Elseif ActivePage = 1 then" etc?

Bob Phillips said:
Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

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

IT_roofer said:
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '==> Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code])
to
get it into a Sheet for printing or is there another method of, like a do
or
while statement, that can perform such a proceedure?


IT_roofer said:
I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!
 
P

Peter T

I don't know what data from what (type of) controls you want to dump, it
would be up to you to know which controls you have on any given page. Maybe
this will give you a lead -

For Each ctr In Me.MultiPage1(MultiPage1.Value).Controls
r = r + 1
Cells(r, 1) = ctr.Name
If TypeOf ctr Is MSForms.TextBox Then
Cells(r, 2) = ctr.Text
End If
Next

Regards,
Peter T

IT_roofer said:
That's what I mean - how do I dump the data? "If ActivePage = 0 then" and
then write the code to fill cells with captions and values and repeat with
"Elseif ActivePage = 1 then" etc?

Bob Phillips said:
Either activate that page and print the form, or dump all the data to a
worksheet range and print that.

--
HTH

Bob

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

IT_roofer said:
Norman and Peter... you two solved a good portion of my problem and I
thank
you both.

How about being able to set that value and applying it to a print
function?
I set a portion of it this way..

Option Explicit
Public ActivePage As String '==> Public so it can be passed to other
funtions right?

Private Sub MultiPage1_Change()
Set ActivePage = MultiPage1.Value
End Sub

The rest of the problem is figuring out how to print out the information
contained in the page because the infomation is deeper than what's
displayed
in the form. Do I need to programaticly put the object name (combobox,
textbox, et al) into an if statement (if ActivePage = 0 then [more code])
to
get it into a Sheet for printing or is there another method of, like a do
or
while statement, that can perform such a proceedure?


:

I know this is possible... I just don't know how to go about it because
'PrintForm' won't work...

I have a print button on the bottom of a UserForm. On that same UserForm,
I
have a MultiPage with 9 tabs. They all contain more information than can
be
displayed on the UserForm. I would like to be able to have the print
button
'detect' which page is active and, somehow, print all the data from the
active page. I know how to code the form to dump all the information from
a
SPECIFIED page into a sheet and make that print. However, I don't know
how to
detect the 'activepage'.

Can anyone help? Thanks in advance!
 

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

Similar Threads

Multipage error 1
Multipage control 3
Multipage userform 5
Initialization using Multipage Tab 4
Userform Multipage 3
Changing page height while in a multipage 2
Multipage?? 1
MultiPage Control 6

Top