I have a main form with a [Send Email] button. This button opens a pop-up dialog form with the option to select:
Option value 1: "Send file as attachment"
Option value 2. "Send file as link"
The user is supposed to make a choice here first and close the pop-up dialog with a [Close] button. Then and only then, the email is sent accordingly.
My problem: The code in my main form keeps running passed the docmd.openform dialog and doesn't wait
for this pop-up dialog to be closed.
I have created a Public variable MyFileSendChoice
where the option is stored. The main form code picks up the choice from this public variable MyFileSendChoice
DoCmd.OpenForm "frm_Attach_or_Link" 'this is the popup dialog
If MyFileSendChoice = InsertEmailLink Then
'send email with link here...
'send email with attachment here...
(The code for sending the email itself is not the problem.)
Can you help? Thanks.
Public MyFileSendChoice As EmailFileDistribution 'Attach file or Insert Link in email
Public Enum EmailFileDistribution