0

Hi,

I want to add a new contact to the table in a database (using ADO Control) but when I write a contact name in a text box it should be automatically changed to upper case even i write in a lower case.

Regards,

user777

3
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by invisal
0

Hi,

I want to add a new contact to the table in a database (using ADO Control) but when I write a contact name in a text box it should be automatically changed to upper case even i write in a lower case.

Regards,

user777

TextBoxes does have an even called "Change", right? well, make .Text=UCase(.Text) there. That's all.

Just be sure your TextBox is "linked" to your ADO Control, and the DataSource and DataField properties are set.

0

there are alot of way to do that, I give you 2 ways to do that

First Way : using Change Event

Private Sub Text1_Change()
    Dim LastStart As Integer
    LastStart = Text1.SelStart
    Text1.Text = UCase(Text1.Text)
    Text1.SelStart = LastStart
End Sub

Second Way : using KeyPress event

Private Sub Text1_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.