Modal form passes sequence without waiting?

  • Thread starter Thread starter news2
  • Start date Start date
N

news2

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
 
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

Hint - acDialog.
 
In
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

You need to open it explicitly in dialog mode:

DoCmd.OpenForm "<name of the form>", WindowMode:=acDialog
 
Thanks, that did it. An earlier suggested solution worked but the compiler
complained.

Dick
 
Back
Top