vba code help

Ravi Kumar

Registered User.
Local time
Tomorrow, 01:24
Joined
Aug 22, 2019
Messages
162
in this below code ,only equipment date is updating but not the other two, could anyone kindly solve this??
Private Sub cmdReminder_Click()
Dim RS As DAO.Recordset
Dim strMsg As String

Set RS = CurrentDb.OpenRecordset("select * from (" & Me.RecordSource & ")", dbOpenSnapshot, dbReadOnly)

With RS
If Not (.BOF And .EOF) Then
.MoveFirst
While Not .EOF
If ![Due Date] > Date - 7 Then
strMsg = strMsg & ![Equipment Name] & vbtab & vbtab & [Agency Name] & vbtab & vbtab & [Due Date] & vbCrLf
End If
.MoveNext
Wend
End If
.Close
End With
Set RS = Nothing
If strMsg <> "" Then
strMsg = "You have to send the following:" & vbCrLf & vbCrLf & _
"------------------------------------------------------------" & vbCrLf & _
"Equipment Name" & vbTab & vtab & "Agency Name" & vtab & vtab & "Due Date" & vbCrLf & _
"------------------------------------------------------------" & vbCrLf & _
strMsg
Else
strMsg = "No record to is due for calibration"
End If

MsgBox strMsg, vbInformation + vbOKOnly
End Sub
 
strMsg = strMsg & ![Equipment Name] & vbtab & vbtab & ![Agency Name] & vbtab & vbtab & ![Due Date] & vbCrLf
 
thank you so much sir....really it meant so much to me.
 

Users who are viewing this thread

Back
Top Bottom