elvenmaiden
Programmer
I am getting an overflow error message if there is information in access to populate the recordset.
Dim datBegin As Date 'holds begin date of report for recordset generation
Dim datEnd As Date 'holds end date of report for recordset generation
If mintDepartmentID > 0 Then
If mstrUser <> "" Then
If DTPBegin.Value > 0 Then
If DTPEnd.Value > 0 Then
If mstrSort <> "" Then
Set rsStats = conHelpPlus.Execute("SELECT qryStats.Name, qryStats.Subject, qryStats.Questions, qryStats.Solutions, SUM(qryStats.Accepted/qryStats.Solutions) as AcceptanceRate from qryStats WHERE qryStats.UserEmail = '" + mstrUser + "' GROUP BY qryStats.Name, qryStats.Subject, qryStats.Questions, qryStats.Solutions"
Set DataReport1.DataSource = rsStats
DataReport1.Show
Else
MsgBox "Please select sort method for report."
optSort(0).SetFocus
End If
Else
MsgBox "Please select an ending date for report."
DTPEnd.SetFocus
End If
Else
MsgBox "Please select a beginning date for report."
DTPBegin.SetFocus
End If
Else
MsgBox "Please select a user"
lstUser.SetFocus
End If
Else
MsgBox "Please select a department"
lstDepartment.SetFocus
End If
Dim datBegin As Date 'holds begin date of report for recordset generation
Dim datEnd As Date 'holds end date of report for recordset generation
If mintDepartmentID > 0 Then
If mstrUser <> "" Then
If DTPBegin.Value > 0 Then
If DTPEnd.Value > 0 Then
If mstrSort <> "" Then
Set rsStats = conHelpPlus.Execute("SELECT qryStats.Name, qryStats.Subject, qryStats.Questions, qryStats.Solutions, SUM(qryStats.Accepted/qryStats.Solutions) as AcceptanceRate from qryStats WHERE qryStats.UserEmail = '" + mstrUser + "' GROUP BY qryStats.Name, qryStats.Subject, qryStats.Questions, qryStats.Solutions"
Set DataReport1.DataSource = rsStats
DataReport1.Show
Else
MsgBox "Please select sort method for report."
optSort(0).SetFocus
End If
Else
MsgBox "Please select an ending date for report."
DTPEnd.SetFocus
End If
Else
MsgBox "Please select a beginning date for report."
DTPBegin.SetFocus
End If
Else
MsgBox "Please select a user"
lstUser.SetFocus
End If
Else
MsgBox "Please select a department"
lstDepartment.SetFocus
End If