Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message box response not assigning true/false to Record

Status
Not open for further replies.

ALRice

Programmer
Jul 17, 2003
11
0
0
US
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.
 
What is the ControlSource of EmailSent ? The name of a field of an updatable query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Emailsent is a yes/no control, where the record is pulled from a table by a query to filter for the next due date (today +4) I am able to update/change/edit information on the form that is powered by the query.

Aim for the moon, for even if we miss, we are still among the stars.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top