Pausing program flow

  • Thread starter Thread starter dchendrickson
  • Start date Start date
D

dchendrickson

I am using Access2002 / XP Pro.

I need some guidence in ways to pause my procedure's
execution.

When a user clicks the OK button on a form, the OnClick
event procedure code looks at the settings on the form.
If certain conditions exist, the code needs to choose
between Overwriting some existing records with new
values, or adding the new values as new records. The user
needs to provide this information.

My current approach is this:

The cmdOK_Click() code for the main form executes an IF
block and determines if the question of Overwrite/Add
needs to be asked.

If it needs asked a popup form is opened (DoCmd.OpenForm)
with two buttons (OverWrite and ADD). The OnClick code
for each button sets a boolean flag to do one or the
other.

But here is the problem, the main code just keeps on
running - not waiting for the popup to set the boolean
value. Is there a handy 'pause' method? Is there a simple
way to make a do-while 'the popup is open' loop?

Thanks in advance.

-dc
 
dchendrickson said:
I am using Access2002 / XP Pro.

I need some guidence in ways to pause my procedure's
execution.

When a user clicks the OK button on a form, the OnClick
event procedure code looks at the settings on the form.
If certain conditions exist, the code needs to choose
between Overwriting some existing records with new
values, or adding the new values as new records. The user
needs to provide this information.

My current approach is this:

The cmdOK_Click() code for the main form executes an IF
block and determines if the question of Overwrite/Add
needs to be asked.

If it needs asked a popup form is opened (DoCmd.OpenForm)
with two buttons (OverWrite and ADD). The OnClick code
for each button sets a boolean flag to do one or the
other.

But here is the problem, the main code just keeps on
running - not waiting for the popup to set the boolean
value. Is there a handy 'pause' method? Is there a simple
way to make a do-while 'the popup is open' loop?

You need to open the form with the optional acDialog argument. Then any
calling code will be paused until that form is either closed or made
hidden.
 
Back
Top