Help! Question on update List box

Help! Question on update List box

Post by Luch » Thu, 17 Jul 2003 10:11:18

I am learning VB and have question on a scenario describe

Dim WithEvents adoDataList As Recordset

Sub Form_load
' read data and fill the form 'select .... ', connect, ....
End Sub

Sub Add_Click()
List.AddItem ("data 1")
List.AddItem ("data 2")
List.DataChanged = True <-- I can see data1 and
data2 been add to the
list. I also use view
local see that
Me.List.DataChanged is
End Sub

Sub Update_Click()
for i =0 to Me.List.RecordCount -1 Then
MsgBox Me.List.itemData(i).text
Next <-- Me.List.RecordCount
Seems correct. But,
is blank. Am I using
the wrong member?
End Sub

Also, how to check if the field entry is number or text?
Somehow, the VB wizard did not verify it, even the
behavior says 'causesValidation' and DataFormat says

Thanks for answers any of the questions!

Help! Question on update List box

Post by West Hi » Tue, 22 Jul 2003 16:08:41

I hope I understand you correctly, but to your first

You were saying that text is blank, you may need to move
the recordset. Another word, in your for statement, put a
rst.movenext. As for your second question on how to check
for number of letter when key is press. You need to use
the keypress event for this.

Hope this helps.