hi, please help me on how to use the textfield_change can you give me an example on this so that i will know how to use this..thanks in advance...hoping for your positive responds....

hi, please help me on how to use the textfield_change can you give me an example on this so that i will know how to use this..thanks in advance...hoping for your positive responds....

what you mean by textfield_change? :confused: is it changing event of a text control? or other? please more details.

Just double click the textbox and write your code !
Or if you want to find or do if the text is changed, then just add an integer and change its value to 1.

The example u needed can be depicted as follows:
Private sub text1_change()
dim blnitemfound as boolean
dim intindex as integer
do while blnitemfound=false or intindex<list1.listcount
if ucase(text1.text)=ucase(left(list1.listindex),len(text1.text))
list1.listindex=intindex
blnitemfound=true
end if
intindex=intindex+1
loop
end sub
This is a prog in which u have a text box and a listbox..when u want to search a particular item from the list box..u have to type in the letters of the word u want to search...as soon as u enter the first letter, the entries starting with that letter will appear and so on...the change is an event of textbox control with the aid of which u cant implement results dynamically like the above example.....

hi sir,

can you give me an example of change event of textbox?....because i did not use this...more power to you .....hoping for your positive responds.....

please give for what u need that ?, i can't understand what u need !
May be this will do it, i used it to create a base notepad .

Dim a As Integer
Dim msgans As String
Dim filename As String
Private Sub RichTextBox1_Change()
a = 1
End Sub
Private Sub SaveButton_Click()
On Error GoTo errhandler
If a = 1 Then
msgans = MsgBox("Text changed ! do you want to save your file ?", vbYesNoCancel + vbCritical, "Save File ...")
If msgans = vbYes Then
CommonDialog1.ShowSave
filiename = CommonDialog1.filename
RichTextBox1.SaveFile (filename & ".txt")
ElseIf msgans = vbNo Then
End
ElseIf msgans = vbCancel Then
Exit Sub
End If
a = 0
Else
End
End If
Exit Sub
errhandler:
MsgBox Err.Description, vbCritical, Err.Number
End Sub

u mean use of textchange?

example you are making a program for grades and you want to have an exception or filter of what you are puting in.. since highest grade you can have is 100 therefore

Private Sub Text1_Change
If Text1.Text >= 101 Then
MsgBox "Invalid Input for grades!" , , "Error Message"
End Sub

i cant really understand what you mean example.. but hope it helped :)

This question has already been answered. Start a new discussion instead.