i m trying to use withevents keyword on my recordset but i do not get to any event and i dont know why
any help will be appreciated
10x
Printable View
i m trying to use withevents keyword on my recordset but i do not get to any event and i dont know why
any help will be appreciated
10x
From MSDN:
I know its for a connection, but the same principle should apply for a recordsetCode:Dim WithEvent connEvent as Connection
Dim conn as New Connection
set connEvent = conn 'Turn on event support.
conn.Open(...)
...
set connEvent = Nothing 'Turn off event support.
...
Private Sub connEvent_ConnectComplete(ByVal err as ADODB.Error, adStatus as ADODB.EventStatus, ByVal pConnectionas ADODB.Connection)
'Check the error object only if adStatus equals adStatusErrorsOccurred.
...
End Sub
Here you go:
Code:Dim WithEvents Rs As Recordset
Dim RecS As New Recordset
Private Sub Form_Load()
Set RecS = Rs
End Sub
Private Sub Rs_FetchComplete(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
Private Sub Rs_FetchProgress(ByVal Progress As Long, ByVal MaxProgress As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
first of all 10x but the same thing that you wrote
for the recordset i tried and didnt succeed
if you try it you will find out that it doesnt work
with the recordset althogh it works on the connection