Combobox not accepting keystroke

John Sh

Active member
Local time
Tomorrow, 02:20
Joined
Feb 8, 2021
Messages
680
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.
 
Hi. Can you post a demo file?
 
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

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...
 
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.
 
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
 
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

Back
Top Bottom