select combobox item by keyborad

amir0914

Registered User.
Local time
Today, 07:29
Joined
May 21, 2018
Messages
151
hi all, i make a combo box and i want when i open the list of combo box and press {enter} key from keyboard add item of list to other subform datasheet...is it possible?

Screenshot (617).png
 
what i would do is add a command button to add it to the subform, therefore i can be clear of the intent.

Private sub button_click()
If me.combo.listindex > -1 then
With me.subformname.form.recordset
.addnew
!fieldname= combo
.update
End with
End sub
 
Thanks arnelgp, but i don't have button, i want to add with keyboard shortcut from combo box directly.
 
I am not in computer right now so i cannot suggest. Just for a test if the code wull work put one button near the combo.
 

Users who are viewing this thread

Back
Top Bottom