solun
Programmer
- Apr 1, 1999
- 55
Okay, I understand what a record set is and how it's created - with a SQL statement. What I don't understand is when they're public or private? in a module or a procedure? I'm getting errors with this code which is simply behind a cmd button:
Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.
Code:
Public Sub Command167_Click()
Dim rstApps As doa.Recordset 'this might be part of the problem
strSQL = "SELECT applicationid, loanid FROM LoanDetailsApplications where loandetailsapplications.loanid=loanid"
'I get the error:Compile error: user-defined type not defined with this line:
Set rstApps = CurrentDb.OpenRecordset(strSQL)
If IsNull(rstApps.RecordCount) Then
MsgBox "No applications have been entered for this loan.", vbOKOnly, "No applications entered!"
Set rstApps = Nothing
Set rstAllSubs = Nothing
Exit Sub
End If
Exit_Command167_Click:
Exit Sub
Err_Command167_Click:
MsgBox Err.Description
Resume Exit_Command167_Click
End Sub
Heidi I. Jones
Ridgerunner Consulting
Questions Answered. Problems Solved.