In reference to thread181-877231 there was discussion of a yes/no field updating when yes was clicked on a message box.
I have tried this, and though it worked once upon a time, I am now getting a run time error '2448' stating that I "can not assign a value to this object"
I am needing to send out an email reminder a few times a month to everyone on a specific mailing list. I Have a table with due dates, A form based on a query that if today - 4 days equals a date on the table, the record is displayed.
I would like to have the message box ask if the mail has been sent and then have the box marked as mail sent if yes is clicked.
here is the code that worked at one time, in a different life, yet is giving me problems now.
Private Sub Form_Close()
If [EmailSent] = 0 Then
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Is Email Reminder Sent?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "MsgBox" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes"
[EmailSent] = True ' ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
End If
End Sub
I also get the same runtime error when i use the following code as well:
Private Sub form_Open ()
If [Datepiece] = "10" Or "25" Then
DoCmd.SendObject , , , "Notification Group", , , "Notification of Due", " Body of email, Thank you so much.", 1
EmailSent = -1
End If
End Sub
Any idea as to why I am unable to update this field and what I must include to do so?
Thank you so much for your insight
Aim for the moon, for even if we miss, we are still among the stars.
I have tried this, and though it worked once upon a time, I am now getting a run time error '2448' stating that I "can not assign a value to this object"
I am needing to send out an email reminder a few times a month to everyone on a specific mailing list. I Have a table with due dates, A form based on a query that if today - 4 days equals a date on the table, the record is displayed.
I would like to have the message box ask if the mail has been sent and then have the box marked as mail sent if yes is clicked.
here is the code that worked at one time, in a different life, yet is giving me problems now.
Private Sub Form_Close()
If [EmailSent] = 0 Then
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Is Email Reminder Sent?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "MsgBox" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes"
[EmailSent] = True ' ' Perform some action.
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
End If
End Sub
I also get the same runtime error when i use the following code as well:
Private Sub form_Open ()
If [Datepiece] = "10" Or "25" Then
DoCmd.SendObject , , , "Notification Group", , , "Notification of Due", " Body of email, Thank you so much.", 1
EmailSent = -1
End If
End Sub
Any idea as to why I am unable to update this field and what I must include to do so?
Thank you so much for your insight
Aim for the moon, for even if we miss, we are still among the stars.