Combobox not accepting keystroke (1 Viewer)

John Sh

Member
Local time
Today, 17:29
Joined
Feb 8, 2021
Messages
408
Another weird problem in access! Is it only me or is Access the most frustrating software out there?
Just as a by the by, I am running the latest update of windows 10 on an MSI X370 SLI PLUS motherboard with AMD Rizen 3 processor and 16Gb of DDR4 ram.
I have a combobox that has an associated select query based on a short table.
The combobox responds to "Keydown", drops the list down but does not record the keystroke.
Nor can I select an item from the dropdown.
I have compared all properties with an earlier working copy of the same form and can find no differences.
The only vba code on the combobox is to dropdown the list on "Keydown" and set the focus to another field, "on click"
The "return" key is set to normal. The code is identical in both copies of the form.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:29
Joined
Oct 29, 2018
Messages
21,358
Hi. Can you post a demo file?
 

John Sh

Member
Local time
Today, 17:29
Joined
Feb 8, 2021
Messages
408
This is the entire DB without the linked images.
some of the code dealing with the "New" button is incomplete otherwise it should be good to go.
The earlier version does not have as much "New" code in it but the combobox works as expected.
I can send that code if required.
You always seem to be the first to respond and I thank you for that.
John
 

Attachments

  • Rathmines Memorial Walls.accdb
    2 MB · Views: 310

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:29
Joined
Oct 29, 2018
Messages
21,358
This is the entire DB without the linked images.
some of the code dealing with the "New" button is incomplete otherwise it should be good to go.
The earlier version does not have as much "New" code in it but the combobox works as expected.
I can send that code if required.
You always seem to be the first to respond and I thank you for that.
John
Hi John. When I opened your file, it naturally wanted me to enable content. Try this test on your end. Rename your file or create a copy with a different name. When you open it, don't enable content and then try to enter something in the Combobox. Is it behaving as expected?

I'll be back after I check your code...
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:29
Joined
Oct 29, 2018
Messages
21,358
Hi John. When I opened your file, it naturally wanted me to enable content. Try this test on your end. Rename your file or create a copy with a different name. When you open it, don't enable content and then try to enter something in the Combobox. Is it behaving as expected?

I'll be back after I check your code...
Okay, I'm back. Check out the code in your Current event and step through it. Let me know what you find.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:29
Joined
May 7, 2009
Messages
19,169
AllowEits must be set to True
Code:
Private Sub Form_Current()
    If Trim(txtService) & "" = "" Then
        txtService = "R.A.A.F."
    End If
    Me.cboName.SetFocus
    'AllowEdits = False
End Sub
 

John Sh

Member
Local time
Today, 17:29
Joined
Feb 8, 2021
Messages
408
By way of explanation.
For the most part I wanted all fields to be inaccessible, hence the "allowedits = false". I decided the easiest way was to lock all controls unless it was a new record.
Once again many thanks for your assistance.
 

Users who are viewing this thread

Top Bottom