A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Modal forms returning values



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2004, 01:20 PM
Simon
external usenet poster
 
Posts: n/a
Default 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  
Old May 28th, 2004, 02:17 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default 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  
Old June 2nd, 2004, 04:55 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.