Hi all,
after much grief -- Ive concluded that the recordcount property doesnt work -- others have said that this is un unreliable property to call. Unfortunately I cant count my recordset using the SQL count function, hence ive written the code below ---
whats wrong with it??!!!!
the command object is set to an access query that uses a parameter object. i is a counter that loops through the records and then returns the count....
_______________________________________________________
cmd.Parameters.Append prmRespCode
Set rst = cmd.Execute
Dim i As Integer ' counts the records
If Not (rst.BOF And rst.EOF) Then ' recordset not empty
rst.MoveFirst
While Not rst.EOF
i = i + 1
rst.MoveNext
Wend
Else
MsgBox ("Recordset Null"
End If
Get_Contacts = CStr(i)
______________________________________________________
ANy ideas?
thankyou all
Hiren
)
after much grief -- Ive concluded that the recordcount property doesnt work -- others have said that this is un unreliable property to call. Unfortunately I cant count my recordset using the SQL count function, hence ive written the code below ---
whats wrong with it??!!!!
the command object is set to an access query that uses a parameter object. i is a counter that loops through the records and then returns the count....
_______________________________________________________
cmd.Parameters.Append prmRespCode
Set rst = cmd.Execute
Dim i As Integer ' counts the records
If Not (rst.BOF And rst.EOF) Then ' recordset not empty
rst.MoveFirst
While Not rst.EOF
i = i + 1
rst.MoveNext
Wend
Else
MsgBox ("Recordset Null"
End If
Get_Contacts = CStr(i)
______________________________________________________
ANy ideas?
thankyou all
Hiren