camellia987
02-04-2008, 09:59
Mình đang làm một bài về listview khi cick lên một dòng dữ liệu thì chi tiết của dòng dữ liệu ấy hiện chi tiết lên một form khác nhưng trong form load lại báo lỗi thế này
Private Sub Form_Load()
Dim rsAuthors As ADODB.Recordset, LItem As ListItem
Set rsAuthors = New ADODB.Recordset
Set rsAuthors = gclsAuthors.GetAuthorsList()
With rsAuthors
On Error Resume Next
Do Until .EOF
Set LItem = lvwAuthors.ListItems.ADD(, "A" & !au_id, !au_lname)
LItem.SubItems(1) = !au_fname
LItem.SubItems(2) = !address
LItem.SubItems(3) = !city
LItem.SubItems(4) = !State
LItem.SubItems(5) = !zip
LItem.SubItems(6) = !phone
LItem.SubItems(7) = !contract
.MoveNext
báo lỗi tại dòng Set rsAuthors = gclsAuthors.GetAuthorsList()
báo lỗi object variable or with block variable not set.
Mình chịu không hiểu tại sao nữa.giúp mình nhé.thnk
Private Sub Form_Load()
Dim rsAuthors As ADODB.Recordset, LItem As ListItem
Set rsAuthors = New ADODB.Recordset
Set rsAuthors = gclsAuthors.GetAuthorsList()
With rsAuthors
On Error Resume Next
Do Until .EOF
Set LItem = lvwAuthors.ListItems.ADD(, "A" & !au_id, !au_lname)
LItem.SubItems(1) = !au_fname
LItem.SubItems(2) = !address
LItem.SubItems(3) = !city
LItem.SubItems(4) = !State
LItem.SubItems(5) = !zip
LItem.SubItems(6) = !phone
LItem.SubItems(7) = !contract
.MoveNext
báo lỗi tại dòng Set rsAuthors = gclsAuthors.GetAuthorsList()
báo lỗi object variable or with block variable not set.
Mình chịu không hiểu tại sao nữa.giúp mình nhé.thnk