Is there a ComboBox$

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

I want to prompt the user for input in one of my event
handlers. I would need to display a ComboBox (verses
InputBox) where they could choose and have it return the
value from the first column. Any such construct? Thanks.
 
No, you'll need to create your own form and use it to get the user's input.
Put a command button on the form, along with your combo box, and then run
code in the command button's click event that hides the form. When you open
the form, open it in dialog mode; then in your calling form's code, right
after the openform action, you can read the value from the combo box and
then you should close that second form.
 
Roger. Wilco. Thanks. Out.

-----Original Message-----
No, you'll need to create your own form and use it to get the user's input.
Put a command button on the form, along with your combo box, and then run
code in the command button's click event that hides the form. When you open
the form, open it in dialog mode; then in your calling form's code, right
after the openform action, you can read the value from the combo box and
then you should close that second form.

--
Ken Snell
<MS ACCESS MVP>

Thanks.


.
 
Dear Ken:

I have done what you suggested. WhatI find is that I
never return to my first (calling) form until I close the
second form. Of course when I close the second form the
data in the text box of the second form is gone. I opened
the seconf form from the first using:

DoCmd.OpenForm "Select Exit Reason", acNormal, , , ,
acDialog

I select the data on the second form and then press the
button I placed on the second form. The code behind the
click is

DoCmd.Minimize


At this point I am hung. What am I doing wrong?
 
What I posted is that the command button (you did put one on the second
form, right?) on the second form must run code in its OnClick event that
hides the second form. Then your first form's code reads the value and
closes the second form.

Code example for first form:

DoCmd.OpenForm "SelectExitReason", , , , , acDialog
VariableName =
Forms("SelectExitReason").Controls("TextboxNameOnSelectExitReasonForm").Valu
e
DoCmd.Close acForm, "SelectExitReason"


The OnClick event of the second form's command button would be this:

Private Sub cmdButtonName_Click()
Me.Visible = False
End Sub
 
Thanks Ken. Done. God bless.

-----Original Message-----
What I posted is that the command button (you did put one on the second
form, right?) on the second form must run code in its OnClick event that
hides the second form. Then your first form's code reads the value and
closes the second form.

Code example for first form:

DoCmd.OpenForm "SelectExitReason", , , , , acDialog
VariableName =
Forms("SelectExitReason").Controls ("TextboxNameOnSelectExitReasonForm").Valu
e
DoCmd.Close acForm, "SelectExitReason"


The OnClick event of the second form's command button would be this:

Private Sub cmdButtonName_Click()
Me.Visible = False
End Sub

--
Ken Snell
<MS ACCESS MVP>




.
 
Back
Top