Combo Box Drop Down Problem

A

Alan

Hi,

Looking for a bit of help. Have a combo box on a form (selecting property
address) when I enter say No 1 the combo box drops down displaying a list of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the property
address and press Enter. The combo box drop down closes and the record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the property
address with the mouse the record selected is displayed on the form but the
Combo box stays in the drop down position and you have to click somewhere
out of the drop down list before it will close. The code on the Combo is
as follows:


After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub


On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub


Any help would be appreciated as I have spent hours trying to get this to
work. Thanks, in advance.
 
S

Shane S via AccessMonster.com

Hey Alan,

I think your problem might be in the OnChange event. Your telling the combo
box to drop down when something changes. Try cutting that part of the code
out and see if the combo box still drops down.

Shane
Hi,

Looking for a bit of help. Have a combo box on a form (selecting property
address) when I enter say No 1 the combo box drops down displaying a list of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the property
address and press Enter. The combo box drop down closes and the record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the property
address with the mouse the record selected is displayed on the form but the
Combo box stays in the drop down position and you have to click somewhere
out of the drop down list before it will close. The code on the Combo is
as follows:

After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub

Any help would be appreciated as I have spent hours trying to get this to
work. Thanks, in advance.
 
A

Alan

Thanks for the reply. Yes if I disable the:

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

Then when I select with the mouse it all works fine. My problem is if I
try to use just the keyboard to select the property then the combo box does
not drop down so I can view the property address. Any suggestions would be
good.




Shane S via AccessMonster.com said:
Hey Alan,

I think your problem might be in the OnChange event. Your telling the
combo
box to drop down when something changes. Try cutting that part of the
code
out and see if the combo box still drops down.

Shane
Hi,

Looking for a bit of help. Have a combo box on a form (selecting
property
address) when I enter say No 1 the combo box drops down displaying a list
of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the property
address and press Enter. The combo box drop down closes and the record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the property
address with the mouse the record selected is displayed on the form but
the
Combo box stays in the drop down position and you have to click somewhere
out of the drop down list before it will close. The code on the Combo is
as follows:

After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub

Any help would be appreciated as I have spent hours trying to get this to
work. Thanks, in advance.
 
D

Duane Hookom

Consider moving the Dropdown to the got focus event.

--
Duane Hookom
MS Access MVP


Alan said:
Thanks for the reply. Yes if I disable the:

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

Then when I select with the mouse it all works fine. My problem is if I
try to use just the keyboard to select the property then the combo box
does not drop down so I can view the property address. Any suggestions
would be good.




Shane S via AccessMonster.com said:
Hey Alan,

I think your problem might be in the OnChange event. Your telling the
combo
box to drop down when something changes. Try cutting that part of the
code
out and see if the combo box still drops down.

Shane
Hi,

Looking for a bit of help. Have a combo box on a form (selecting
property
address) when I enter say No 1 the combo box drops down displaying a list
of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the property
address and press Enter. The combo box drop down closes and the record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the
property
address with the mouse the record selected is displayed on the form but
the
Combo box stays in the drop down position and you have to click somewhere
out of the drop down list before it will close. The code on the Combo
is
as follows:

After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub

Any help would be appreciated as I have spent hours trying to get this to
work. Thanks, in advance.
 
A

Alan

If I move it to the got focus event then when I select using the Arrow keys
or mouse the combo box stays in the drop down state.


Duane Hookom said:
Consider moving the Dropdown to the got focus event.

--
Duane Hookom
MS Access MVP


Alan said:
Thanks for the reply. Yes if I disable the:

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

Then when I select with the mouse it all works fine. My problem is if I
try to use just the keyboard to select the property then the combo box
does not drop down so I can view the property address. Any suggestions
would be good.




Shane S via AccessMonster.com said:
Hey Alan,

I think your problem might be in the OnChange event. Your telling the
combo
box to drop down when something changes. Try cutting that part of the
code
out and see if the combo box still drops down.

Shane

Alan wrote:
Hi,

Looking for a bit of help. Have a combo box on a form (selecting
property
address) when I enter say No 1 the combo box drops down displaying a
list of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the property
address and press Enter. The combo box drop down closes and the record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the
property
address with the mouse the record selected is displayed on the form but
the
Combo box stays in the drop down position and you have to click
somewhere
out of the drop down list before it will close. The code on the Combo
is
as follows:

After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub

Any help would be appreciated as I have spent hours trying to get this
to
work. Thanks, in advance.
 
D

Duane Hookom

Press escape or enter or tab to move off the combo box and it should suck
up.

--
Duane Hookom
MS Access MVP


Alan said:
If I move it to the got focus event then when I select using the Arrow
keys or mouse the combo box stays in the drop down state.


Duane Hookom said:
Consider moving the Dropdown to the got focus event.

--
Duane Hookom
MS Access MVP


Alan said:
Thanks for the reply. Yes if I disable the:

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

Then when I select with the mouse it all works fine. My problem is if
I try to use just the keyboard to select the property then the combo box
does not drop down so I can view the property address. Any suggestions
would be good.




Hey Alan,

I think your problem might be in the OnChange event. Your telling the
combo
box to drop down when something changes. Try cutting that part of the
code
out and see if the combo box still drops down.

Shane

Alan wrote:
Hi,

Looking for a bit of help. Have a combo box on a form (selecting
property
address) when I enter say No 1 the combo box drops down displaying a
list of
all propertiers starting with 1 ( i.e. 1 North Street, 1 South Street,
etc.) I then use the arrow keys on the keyboard to move to the
property
address and press Enter. The combo box drop down closes and the
record
selected is displayed on the form.

The problem I have if after the combo box drops down I select the
property
address with the mouse the record selected is displayed on the form but
the
Combo box stays in the drop down position and you have to click
somewhere
out of the drop down list before it will close. The code on the Combo
is
as follows:

After Update event:

Sub Combo27_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PropID] = " & Me![Combo27]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

On Change Event

Private Sub Combo27_Change()
Me!Combo27.Dropdown
End Sub

On Exit Event:

Private Sub Combo27_Exit(Cancel As Integer)
On Error GoTo Combo27_Exit_Err

Combo27 = Null

Combo27_Exit_Exit:
Exit Sub

Combo27_Exit_Err:
MsgBox Error$
Resume Combo27_Exit_Exit

End Sub

Any help would be appreciated as I have spent hours trying to get this
to
work. Thanks, in advance.
 

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