# Re: listbox选项填入资料库的问题~~~~~求救!!

Posted by styler on October 14, 1999 at 09:55:41:

In Reply to: listbox选项填入资料库的问题~~~~~求救!! posted by 阿帝拉 on October 13, 1999 at 15:29:52:

Dim I As Integer
list.listindex = 0
For I = 0 To List1.ListCount - 1
Data1.Recordset.AddNew
Data1.Recordset.fields("栏位名称") = list1.Text
Data1.Recordset.Update
list1.listindex = list1.listindex + 1
Next I

应该是这样吧.下面是我用dataenvironment方式写的可以用,改过来应该就是上面用样啰....
请先确定recordset 可新增

Private Sub Command2_Click()
Dim I As Integer
List1.ListIndex = 0
For I = 0 To List1.ListCount - 1
DataE.rscc2.AddNew
DataE.rscc2.Fields("Stu_Id") = List1.Text
DataE.rscc2.Update
List1.ListIndex = I
Next I
End Sub

Follow Ups: