Force uppercase entry after update of combo box

  • Thread starter Thread starter Joe Best
  • Start date Start date
J

Joe Best

Looking for a way to do this if anyone can help please.

I have a combo box on a form named cmbClient (control source is Client)
which looks up a value from a separate Clients table. After this field is
populated using the combo box, I would like the value stored to be
uppercase.

Many thanks,

Joe.
 
One way is to convert the field in code. Put the
following code in the after update event for that field.

Private Sub Fieldname_AfterUpdate()
Fieldname = UCase(Fieldname)
End Sub

Jim
 
Joe,

You need to use a the UCase function. Here is an on click
routine that you can add to the code of your form. Of
course you will need to modify it for your purposes.

Option Compare Database
Option Explicit
Public gstrClient as String

Private Sub cmdOk_Click()

On Error GoTo Error_handler:

gstrClient = UCase(cmbClient.Column(0))
DoCmd.Close

Exit Sub

Error_handler:
MsgBox "Please enter or select Client Name"
Exit Sub

End Sub

Good luck.

Bart
 
Back
Top