Halting Procedure for user input

J

Jim

Hi,

I've got a form module procedure in which I'd like the
code to pause at a particular point for user input. The
Inputbox() function does precisely what I need, except
that I'd like for the user to be able to select from a
combo box (rather than having to type longhand in a
textbox).

strInput = Inputbox("Please enter the method of
transmittal:")

Alternatively, I've created a simple dialog box form
containing the combo box I need. However, opening up the
dialog box from within the procedure does not halt the
procedure.

Does anyone have any suggestions on how to stop the
procedure until the user has made a selection from the
dialog box?

Thanks,

Jim
 
D

Dirk Goldgar

Jim said:
Hi,

I've got a form module procedure in which I'd like the
code to pause at a particular point for user input. The
Inputbox() function does precisely what I need, except
that I'd like for the user to be able to select from a
combo box (rather than having to type longhand in a
textbox).

strInput = Inputbox("Please enter the method of
transmittal:")

Alternatively, I've created a simple dialog box form
containing the combo box I need. However, opening up the
dialog box from within the procedure does not halt the
procedure.

Does anyone have any suggestions on how to stop the
procedure until the user has made a selection from the
dialog box?

When you open your form, specify that you want it opened in dialog mode:

DoCmd.OpenForm "frmPrompt", WindowMode:=acDialog

The calling code will pause until form "frmPrompt" is closed or hidden.
Have you figured out how to get the selected value back from the dialog
form? One way is to hide it instead of closing it, then let the calling
code retrieve the value from the hidden form before closing it using
DoCmd.Close acForm, "frmPrompt".
 

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