This MUST be simple.
I have a modal form that asks for entry of one field and has an OK button.
For the only field on the form I have a got-focus sub to load the field with
a default value.
The OK button has a sub to move the contents of the field to an external
public variable and then docmd.close.
What happens is that when the form is opened with
DoCmd.OpenForm "<name of the form>", acNormal
the calling procedure continues to the succeeding statement without waiting
for the form's OK to be hit. The form remains visible.
Hints????
Dick
storrboy - 28 Mar 2007 21:22 GMT
On Mar 28, 4:17 pm, n...@rgcle.com wrote:
> This MUST be simple.
>
[quoted text clipped - 16 lines]
>
> Dick
Hint - acDialog.
Dirk Goldgar - 28 Mar 2007 21:39 GMT
> This MUST be simple.
>
[quoted text clipped - 17 lines]
>
> Dick
You need to open it explicitly in dialog mode:
DoCmd.OpenForm "<name of the form>", WindowMode:=acDialog

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Albert D. Kallal - 28 Mar 2007 22:43 GMT
First, don't use a global var to pass, or retrieve values (a bad programming
practice).
To retrieve values from a form, and make the form halt, I explain how here:
http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html

Signature
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
news2@rgcle.com - 29 Mar 2007 01:37 GMT
Thanks, that did it. An earlier suggested solution worked but the compiler
complained.
Dick