I am NEW at this, but I have a command button on a form that is set to
docmd.openreport("All UnReceipted Donations") acPreview
I am trying to use the MsgBox but am having trouble with formatting it and with causing it to effect a result.
I want to use a yes/no MSG pop up windows with a message next to say "Do you want to Print the report?"
If YES, I want to initiate a docmd.openreport("all unreceipted donations") acPrint -- if No, I want to do Nothing - end event (previewed reports are just left where they are.)
If they chose YES, Print, I want to have another message box pop up that says "Did the receipts print properly?"
If YES is selected, I want to run an update query that I have written to update the "Receipt_Generated" filed in the IndDonations table to YES. (so that the next time receipts are generated it will be only for the people that have no receipts)
If NO, I want it to ask Print Again or cancel? and if Print Again, start the loop over at the "Did the receipts Print Properly ?"
I do NOT want the command to cause the update query to run if the user stops the process at any point. (i.e., I only want to run it if one of the above printed correctly yes/no commands is YES)
Thus, if I put it in a string after the
DoCmd.OpenReport acPreciew
MsgBox (??????) "Do you want to Print the receipt ?" (the event needs to stop and wat for a YES or No)
If No, stop entirely (cancel event)
If Yes, initiate Print and pop up MSGBox (????) "Did the receipt print correctly ?"
If Yes, DoCmd RunQuery "update query", if no, MSGBox "Do you want to try to Print Again" (Yes or Cancel - or No) and if Yes, initiate PrintReport again and ask Printed yes/no again and
and if Cancel/No - end event.
How can I do this ? I tried creating additional Forms that ask each question with a Yes command button and a No commnd button on the forms, and set the event for the yes/no buttons, but would like to do it with the MsgBox if that is a better way to accomplish this (why have a yes/no cancel message box if it does nto cause anythig to happen)

docmd.openreport("All UnReceipted Donations") acPreview
I am trying to use the MsgBox but am having trouble with formatting it and with causing it to effect a result.
I want to use a yes/no MSG pop up windows with a message next to say "Do you want to Print the report?"
If YES, I want to initiate a docmd.openreport("all unreceipted donations") acPrint -- if No, I want to do Nothing - end event (previewed reports are just left where they are.)
If they chose YES, Print, I want to have another message box pop up that says "Did the receipts print properly?"
If YES is selected, I want to run an update query that I have written to update the "Receipt_Generated" filed in the IndDonations table to YES. (so that the next time receipts are generated it will be only for the people that have no receipts)
If NO, I want it to ask Print Again or cancel? and if Print Again, start the loop over at the "Did the receipts Print Properly ?"
I do NOT want the command to cause the update query to run if the user stops the process at any point. (i.e., I only want to run it if one of the above printed correctly yes/no commands is YES)
Thus, if I put it in a string after the
DoCmd.OpenReport acPreciew
MsgBox (??????) "Do you want to Print the receipt ?" (the event needs to stop and wat for a YES or No)
If No, stop entirely (cancel event)
If Yes, initiate Print and pop up MSGBox (????) "Did the receipt print correctly ?"
If Yes, DoCmd RunQuery "update query", if no, MSGBox "Do you want to try to Print Again" (Yes or Cancel - or No) and if Yes, initiate PrintReport again and ask Printed yes/no again and
and if Cancel/No - end event.
How can I do this ? I tried creating additional Forms that ask each question with a Yes command button and a No commnd button on the forms, and set the event for the yes/no buttons, but would like to do it with the MsgBox if that is a better way to accomplish this (why have a yes/no cancel message box if it does nto cause anythig to happen)

Last edited: