12-18-2003, 04:18 PM
Why doesn't this work????

'Checks to see if data in MakeTable
strSQL = "SELECT * from [T_Audit_MakeTable]"
recMakeTable.Open strSQL, cnnRetDtbse, adOpenDynamic, adLockOptimistic

If recMakeTable.RecordCount < 1 Then
MsgBox "No records available for the selected month.", vbOKOnly
Screen.MousePointer = vbDefault '
Unload Me
Exit Sub
End If

'''I keep getting a -1 for recordcount even though I know that the table has records. No matter what I've tried, I get -1.....WHY??? :huh:

Please help....Thanks :D

12-18-2003, 04:21 PM
use one of the move methods to move to the end of the recordset before calling the recordcount property.

12-18-2003, 04:27 PM
Set the connection to use adUseClient for the CursorLocation property before you open the connection and the RecordCount property should work properly.

12-18-2003, 06:40 PM
If recMakeTable.BOF And recMakeTable.EOF Then

Is the more proper way to check for an empty recordset.

12-19-2003, 07:08 AM
Thanks for all of your help!!! Merry Christmas to all!!!!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum