Monday, August 17, 2020

Recordset RecordCount VBA C# .net

Sometime we have to count record set and take decision wheather to show result in excel or not. If count is too much excel can crash. for that people are running same query two times, one time count and another time display record. In order to avoid this run query onece and take decision. like following:- If Recordset.RecordCount > 20000 Then Response = MsgBox(WorksheetFunction.text(Recordset.RecordCount, "_(* #,##0_);_(* (#,##0);_(* ""-""??_);_(@_)") & "Records......Continue?", vbYesNo) If Response = vbNo Then GoTo CleanUp_Exit End If https://docs.microsoft.com/en-us/office/client-developer/access/desktop-database-reference/recordset-recordcount-property-dao

No comments: