Combo Keypress to Uppercase in Datasheet

Machnee

New member
Local time
Today, 13:38
Joined
Jan 22, 2018
Messages
3
We use an event like this to convert keystrokes to uppercase:

Code:
Private Sub cboTest_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
It does not seem to work for ComboBoxes in Datasheet mode. The event fires, but keystrokes show up as lower case.

Textboxes work in datasheet and Form mode. Changing the subform to Form view also works. The same behaviour exists in 2003 and 2016. I can replicate the bug with a trivial Combo with a list of data values.

Is this just a bug?
 
I can’t answer your question directly, but I can tell you I have made a custom routine thst loops through the forms Text and Combo box’s and converts then to Upper case. It is on the BeforeUpdate event and works like a charm...
 
I can’t answer your question directly, but I can tell you I have made a custom routine thst loops through the forms Text and Combo box’s and converts then to Upper case. It is on the BeforeUpdate event and works like a charm...

Thanks for the idea.

All the values in the combo are uppercase already, and limit to list is set in this case, so it will only save uppercase. We just want it to look better for the user when it converts to uppercase as they type.
 
Ah...yeah, I looked into that method as well but it seemed a bit much so I opted for my method instead.

Sorry I couldn’t help, best of luck.
 
Ah...yeah, I looked into that method as well but it seemed a bit much so I opted for my method instead.

Sorry I couldn’t help, best of luck.

I'm always open to suggestions. Thx:D

We use this in other places, and it does work nicely, including comboboxes and textboxes that are directly on forms. Just not comboboxes on datasheets for whatever reason.
 

Users who are viewing this thread

Back
Top Bottom