starclassic
Technical User
Hello eveyone,
I created a query below and supply the date from form frmQueue but when clicked on firstContact button gives me a error.
debug would show on
Set rst = dbs.OpenRecordset("qryFirst")
Any help greatly appreciated.
~~~~~~~~~~~~~~~~~~qryFirst~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT tblCollectionsData.PremCancelDate, tblCollectionsData.CancelDate, tblCollectionsData.Class, tblCollectionsData.PolicyType, tblCollectionsData.ContactMain
FROM tblCollectionsData
WHERE (((tblCollectionsData.PremCancelDate) Is Not Null) And ((tblCollectionsData.CancelDate) Between Forms!frmQueue!txtStartCanDate And Forms!frmQueue!txtEndCanDate) And ((tblCollectionsData.ContactMain)="0"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub cmdFirstContact_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim LetterCount As Integer
Dim LetterMessage As String
Dim stDocName As String
Dim StrSql As String
Set dbs = CurrentDb
LetterCount = DCount("*", "qryFirst")
* Set rst = dbs.OpenRecordset("qryFirst") *
DoCmd.SetWarnings False
If LetterCount = 0 Then
MsgBox ("You have " & LetterCount & " First Letter to Send."), vbInformation, "Collections Database"
Exit Sub
Else
MsgBox ("You have " & LetterCount & " First Letter to Send."), vbInformation, "Collections Database"
I created a query below and supply the date from form frmQueue but when clicked on firstContact button gives me a error.
debug would show on
Set rst = dbs.OpenRecordset("qryFirst")
Any help greatly appreciated.
~~~~~~~~~~~~~~~~~~qryFirst~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT tblCollectionsData.PremCancelDate, tblCollectionsData.CancelDate, tblCollectionsData.Class, tblCollectionsData.PolicyType, tblCollectionsData.ContactMain
FROM tblCollectionsData
WHERE (((tblCollectionsData.PremCancelDate) Is Not Null) And ((tblCollectionsData.CancelDate) Between Forms!frmQueue!txtStartCanDate And Forms!frmQueue!txtEndCanDate) And ((tblCollectionsData.ContactMain)="0"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub cmdFirstContact_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim LetterCount As Integer
Dim LetterMessage As String
Dim stDocName As String
Dim StrSql As String
Set dbs = CurrentDb
LetterCount = DCount("*", "qryFirst")
* Set rst = dbs.OpenRecordset("qryFirst") *
DoCmd.SetWarnings False
If LetterCount = 0 Then
MsgBox ("You have " & LetterCount & " First Letter to Send."), vbInformation, "Collections Database"
Exit Sub
Else
MsgBox ("You have " & LetterCount & " First Letter to Send."), vbInformation, "Collections Database"