Msg Box

K

Kajo

Hi!
I've done a code to show a message box before the printing starts to show
how many pages you need to the printing. I kind of "pop-up" box. The trouble
is that you don't have a chance to figure out what It says until its gone! I
would like to stop at the msg box so the user can press OK before it
disappears.
The code is as follows:
Privat Sub PageHeaderSection_Print(Cancel As Integer, Printcount As Integer)
If Not boPagesShown Then
MsgBox Me.Pages & "pages."
boPagesShown = True
End If
End Sub

Thanks in advance!
 
J

Jacco

Kajo said:
Hi!
I've done a code to show a message box before the printing starts to show
how many pages you need to the printing. I kind of "pop-up" box. The
trouble
is that you don't have a chance to figure out what It says until its gone!
I
would like to stop at the msg box so the user can press OK before it
disappears.
The code is as follows:
Privat Sub PageHeaderSection_Print(Cancel As Integer, Printcount As
Integer)
If Not boPagesShown Then
MsgBox Me.Pages & "pages."
boPagesShown = True
End If
End Sub

Thanks in advance!
You can also make it a Yes/No fiels (or OK/Cancel).

answer=MsgBox("Your messgae", vbYesNo, "Name Pop Up box")
if answer=yes etc.....
 
J

Jacco

Jacco said:
You can also make it a Yes/No fiels (or OK/Cancel).
answer=MsgBox("Your messgae", vbYesNo, "Name Pop Up box")
if answer=vbYes etc.....

sorry, typo
 
K

Kajo

Thank you!
But could you please give me the whole programcode or tell me which part of
the code that should be replaced. It's been a while since I've done it so I
need a step-to-step instruction to be shure that everything will work as
planned! Thank you for fast reply! :)
 
J

Jacco

Kajo said:
Thank you!
But could you please give me the whole programcode or tell me which part
of
the code that should be replaced. It's been a while since I've done it so
I
need a step-to-step instruction to be shure that everything will work as
planned! Thank you for fast reply! :)

The actual Idea is that you write the code ;)
I think your problem would be here already. The place where you put the code
is based on a print... but you want the message before a print... I do not
have your complete code either... I can just tell you how to code the
message box.

Privat Sub PageHeaderSection_Print(Cancel As Integer, Printcount As
Integer)

End Sub

This should become the actual pop-up coding when you are done. I just do not
know where to put it. Good luck

Dim intReturn As Integer
intReturn = MsgBox("This printout will use " & Me.Pages & " pages.
Continue?", vbYesNo, "Pages")

Select Case intReturn
Case vbYes
'proceed to printing
'insert the printing code here
Case vbNo
'cancel printing
'here is the cancelation code.
End Select
 

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