Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print msgbox

Status
Not open for further replies.

chinese1

Technical User
Jul 19, 2008
3
US
How do I print a message displayed in my form using the msgbox() function?
 
Which problem have you with the MsgBox function ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,
Thank you for replying to my post.

Sorry,I think my message was not clear. In my form I have this code in the after update events:

If me.invamt >= 5000.00 then msgbox "Approval Required".

It then pop up a message to remind the user.

I want to send this message to the printer. I tried debug.print and it doesn't work.

 
chinese1,
I don't believe there is an easy way to print the VBA [tt]MsgBox[/tt], most solutions I have seen require using API's to screen capture a bitmap of the box, saving it, then direct to the printer...

Have you looked at designing a Report that contains the pertinent information on the transaction that requires approval then use [tt]DoCmd.OpenReport()[/tt] in conjunction with [tt]MsgBox[/tt] to direct the details to a printer?

Just a thought,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Thank you, CautionMP

I created a form "MyMessage", added a label to hold my message. Then put the following after update code in the invamt field.

if me.invamt >= 5000 then
docmd.openform "MyMessage"
end if

On the form "MyMessage" I put this code in the activate event:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

It now print and display the form to the user.

Chinese1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top