Hi, I simply need to convert a text box to UpperCase, and then store in underlying table (it's a "City" address field,entered in an input form, to use in mailmerge for addressing mail in the UK).
I've found two methods, one using AfterUpdate & "UCase", the other using OnKeyPress & "KeyAscii", neither seem to be having any effect ?
The code is as follows:
AfterUpdateEvent -
Private Sub City_AfterUpdate()
Me.City = UCase(Me.City)
End Sub
(I've also tried this with a "!" instead of the ".")
OnKeyPress -
Private Sub City_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
I'm a total novice at this so it may well be something very obvious! Can anyone suggest where I'm going wrong ?
Regards
I've found two methods, one using AfterUpdate & "UCase", the other using OnKeyPress & "KeyAscii", neither seem to be having any effect ?
The code is as follows:
AfterUpdateEvent -
Private Sub City_AfterUpdate()
Me.City = UCase(Me.City)
End Sub
(I've also tried this with a "!" instead of the ".")
OnKeyPress -
Private Sub City_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
I'm a total novice at this so it may well be something very obvious! Can anyone suggest where I'm going wrong ?
Regards