acDialog set but code keeps going?

  • Thread starter trevorC via AccessMonster.com
  • Start date
T

trevorC via AccessMonster.com

P = MsgBox("Send E-Mail now !, Click Yes to Preview the output or No to
continue with E-Mail or Cancel to end", vbYesNoCancel, "E-Mail automation")
If P = vbCancel Then
Exit Sub
Else
If P = vbYes Then
DoCmd.OpenForm "Dispatch Details", acFormDS, , , , acDialog
Else
End If
End If

Hi All,
The above code works fine until P = vbYes, the code loads the form in
datasheet veiw and acdialog mode but the code continues after loading the
form.

Any help is appreciated
regards
TrevorC
 
A

Allen Browne

This is a bug in Access, Trevor.

You need to use a view other than Datasheet view for the code to behave as
it should.
 
D

David W. Fenton

You need to use a view other than Datasheet view for the code to
behave as it should.

The usual method is to embed a datasheet subform in an empty main
form, which will be displayed in regular form view, and thus will
respect the acFormDS parameter.
 
D

David W. Fenton

The usual method is to embed a datasheet subform in an empty main
form, which will be displayed in regular form view, and thus will
respect the acFormDS parameter.

That was actually quite inelegantly worded:

The embedded form that is set to open only as a datasheet will
always be a datasheet, no matter how the parent form is opened.

And you won't need the acFormDS parameter at all when opening the
parent form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top