After the statement:
Set rs = db.OpenRecordset(strSQL)
executes I would like to check to see if any records were selected, if not (no records selected) then display an appropriate message and exit.
What is the statement to check if any records were selected? If records were not selected what statements should be included to properly close anything opened (i.e. by the OpenRecordSet)
Here's is some of the code (stripped out some irrelevant details)
Set rs = db.OpenRecordset(strSQL)
executes I would like to check to see if any records were selected, if not (no records selected) then display an appropriate message and exit.
What is the statement to check if any records were selected? If records were not selected what statements should be included to properly close anything opened (i.e. by the OpenRecordSet)
Here's is some of the code (stripped out some irrelevant details)
Code:
Private Sub cmdCreateFile_Click()
On Error GoTo Err_cmdCreateFile_Click
Dim intCkSum As Byte
Dim db As Database
Dim nH As Integer
Dim rs As Recordset
Dim Buffer As String, strSQL As String
*(code removed from these tasks)
'Init
'Clear ErrMsg in case user had to correct input
'Check That Dates Are Valid
'Select Records
strSQL = "SELECT APCHECK.APCHNUM, {code removed}
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
*** At this point I want to check to see if any records were selected. If so then continue with the process, if not then exit - closing anything left open ***