alter a boolean field from no to yes with VBA (1 Viewer)

Lanser

Registered User.
Local time
Today, 15:14
Joined
Apr 5, 2010
Messages
60
I use the following to send a .pdf to the required email and it works well, but is it possible to include a boolean yes/no field in the table that holds the data and change it from no to yes in VBA so I know when a record has been emailed?

Code:
Private Sub SendEmailToAssignedTo_Click()
    
    
        Dim strFilter As String
            strDocName = "IssueAlert"
            strFilter = "Id = Forms!frmAlarm!ID"
        
        DoCmd.OpenReport strDocName, acPreview, , strFilter
        
       Dim blRet As Boolean
blRet = ConvertReportToPDF("IssueAlert", , "T:\Issues\Issue_Alert_" & Forms!frmAlarm!ID & ".pdf", False, False)
        
        DoCmd.Close acReport, "IssueAlert"
End Sub
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:14
Joined
Aug 30, 2003
Messages
36,127
Sure; probably the simplest way:

CurrentDb.Execute "UPDATE TableName SET FieldName = True WHERE Id = " & Forms!frmAlarm!ID
 

Users who are viewing this thread

Top Bottom