How to pause for input in a while loop

  • Thread starter Thread starter Boon
  • Start date Start date
B

Boon

Hi,

I have a while loop like the one below

While i<=10 do

docmd.openform "FormA", ....
i=i+1
loop


I want the loop to stop after formA is open. (So that I will ask for
information in form A and update the table through SQL code -
docmd.runsql.... How can I do this?


Thanks,
 
It will loop throught number 1 to 10 and I would like the user input data
for each one of them.
 
Hi Boon

If you open the form in dialog mode (aka modally) then your code execution
will be suspended until Form! is either closed or made invisible.

Use the WindowMode argument for OpenForm, which is the sixth argument.

Either:
DoCmd.OpenForm "FormA", , , , ,acDialog

Or use a named argument:
DoCmd.OpenForm "FormA", WindowMode:=acDialog
 
thanks,

This acDialog works great!

Graham Mandeno said:
Hi Boon

If you open the form in dialog mode (aka modally) then your code execution
will be suspended until Form! is either closed or made invisible.

Use the WindowMode argument for OpenForm, which is the sixth argument.

Either:
DoCmd.OpenForm "FormA", , , , ,acDialog

Or use a named argument:
DoCmd.OpenForm "FormA", WindowMode:=acDialog

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


Boon said:
Hi,

I have a while loop like the one below

While i<=10 do

docmd.openform "FormA", ....
i=i+1
loop


I want the loop to stop after formA is open. (So that I will ask for
information in form A and update the table through SQL code -
docmd.runsql.... How can I do this?


Thanks,
 
Back
Top