Stop code waiting for user input from a form

C

Coby

Is there a way to pause my module and then resume (as part of the
subroutine itself)?

I want to stop the code and get the user's input via a combo list box
on a form, then resume the code where it left off once the user clicks
an ok button.

I basically want to have the same effect as the standard input box,
but using a form so I can utilize a combo list box



What I have been trying to do is:


Do While Not rstLumberOrder.BOF
If !InvalidDescription = <>"" Then
Application ???? pause???
DoCmd.OpenForm("SubstitutionChoices")
rstLumberOrder.MovePrevious
Loop

Then,

I want to resume the code looping when a button click even occurs from
the form that is open.


Is there any way of doing this or something to get me the equivalent?

Thanks in advance for any help.

Coby.
 
S

Steve

You can open a popup form with:
DoCmd.OpenForm "NameOfPopupForm",,,,,acDialog

The code will stop at that line and will resume when the popup form is made
not visible or is closed. You can put your combobox on the popup form and
your other form can refer to that combobox. You can put the following code
in the AfterUpdate event of the combobox:
Me.Visible = False
and then put the following code at the end of your main code:
DoCmd.Close "Forms!NameOfPopupForm"

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
C

Coby

I explain in detail how to halt code...use a form, and then examine the
values of the text boxes on that form.

And, you can do this without the need for global vars...http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html


Excellent! I just tried it out and it works exactly the way I need it
to. And, I understand how to pick up where I left off. I had
searched through several books to find this, yet the whole picture had
never been clear until now.

Thanks a million.

Coby.
 
C

Coby

You can open a popup form with:
DoCmd.OpenForm "NameOfPopupForm",,,,,acDialog

The code will stop at that line and will resume when the popup form is made
not visible or is closed. You can put your combobox on the popup form and
your other form can refer to that combobox. You can put the following code
in the AfterUpdate event of the combobox:
Me.Visible = False
and then put the following code at the end of your main code:
DoCmd.Close "Forms!NameOfPopupForm"

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)













- Show quoted text -



Yes, Steve, that is it! I got it now and appreciate the help
tremendously.
I have my work cut out form me now and am off and running.

Thanks, again.
Coby.
 
S

Steve

Let me know if you need further help!

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 

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

Top