我想把Client傳回來的資料自動顯示在grid裡,程式如下:Private Sub tcpServer_DataArrival(index As Integer, ByVal bytesTotal As Long)
Dim strdata As String
Dim n1 As String
tcpServer(1).getdata strdata
n1 = Mid(strdata, 1, 1)
Select Case n1
Case "a"
txtname.Caption = Mid(strdata, 2)
Call nex
Case "b"
txtip.Caption = Mid(strdata, 2)
Case "c"
txttotal.Text = Mid(strdata, 2)
End Select
End Sub
Sub nex()
rs.AddNew "username", txtname.Caption
End Sub
卻出現 沒有設定物件變數或with區塊變數的錯誤訊息(err91)
但若設定一個button,如下:
Private Sub Command1_Click()
Call nex
End Sub
卻可以將傳回資料顯示在grid裡,但不想用手動來新增資料.
不知程式哪裡錯了????