If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Modal forms returning values
I want to be able to offer the user the option to print,
preview, e-mail or export a report using a pop-up form when the click report on a 'main' form. I know that if I open a form using acDialog from the code on main, that code will suspend until the user close the modal pop-up, but what's the best way to pass their selection (i.e. if they click 'e-mail') back to the main code to process? |
#2
|
|||
|
|||
Modal forms returning values
"Simon" wrote in message
... I want to be able to offer the user the option to print, preview, e-mail or export a report using a pop-up form when the click report on a 'main' form. I know that if I open a form using acDialog from the code on main, that code will suspend until the user close the modal pop-up, but what's the best way to pass their selection (i.e. if they click 'e-mail') back to the main code to process? What I usually do is offer an [OK] and a [Cancel] button on the popup. [Cancel] closes the popup and [OK] just hides it (which also lets your calling code continue). Then in the calling code I do something like... (code uses the IsLoaded() function from the Northwind sample database) DoCmd.OpenForm "MyPopup",,,,,acDialog If IsLoaded("MyPopUp") = True 'User pressed [OK] MyVariable = Forms!MyPopUp!SomeControl DoCmd.Close acForm "MyPopUp" Else 'User pressed [Cancel] (do whatever) End If -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
#3
|
|||
|
|||
Modal forms returning values
Simon,
See if this helps: http://www.pacificdb.com.au/MVP/Code/MyDialog.htm Regards, Graham R Seach Microsoft Access MVP Sydney, Australia Microsoft Access 2003 VBA Programmer's Reference http://www.wiley.com/WileyCDA/WileyT...764559036.html "Simon" wrote in message ... I want to be able to offer the user the option to print, preview, e-mail or export a report using a pop-up form when the click report on a 'main' form. I know that if I open a form using acDialog from the code on main, that code will suspend until the user close the modal pop-up, but what's the best way to pass their selection (i.e. if they click 'e-mail') back to the main code to process? |
Thread Tools | |
Display Modes | |
|
|