Check Boxes (1 Viewer)

alguzman

Registered User.
Local time
Today, 02:13
Joined
Aug 2, 2001
Messages
63
Have two check boxes. 1. sendemail and 2. sentemail. I have a cmdbutton to send email to everyone in database that was checked off for sendemail. I want the code to then clear the sendemail checkbox and automatically check the sentemail checkbox. Right now when you check off sendemail and then hit the cmdbutton to send a email the check boxes change but the code to send the email is not run. If I take out the code for the check boxes then the email is sent. Here is my code:

Private Sub Command68_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("First Hotel Reg")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EMail").Value
DoCmd.SendObject , , , strEmail, , , "AC Pool & Spa Show Hotel Registration", "Dear 2003 Atlantic City Pool & Spa Show Exhibitor: Once again, we are pleased to offer our exhibitors the opportunity to make your housing reservations for the 2002 Show via the internet at www.nespapool.org. Click on the link, then on AC Show, then on Exhibitor Housing Reservations On-line. Here is your code - spagen0103. Only exhibiting companies who have submitted their space application have received this information and therefore you have first choice for all hotels. Please take advantage of this opportunity and reserve your rooms quickly, as the site opens to attendees beginning October 16. If you do not wish to make your reservations on-line call (732)972-9111 give us your exhibitor access code and have Housing Reservation form faxed to you. Follow the instructions and mail/fax to AC Housing Bureau. Numbers/Address on form. Exhibitor badge reg. info. will be forwarded to you within a few weeks", False
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
me.sendemail=0
me.sentemail=-1
end sub

This code is in the click event of the command68_button which is the command button that sends the email. Any help would be great. Thanks
 

Fizzio

Chief Torturer
Local time
Today, 02:13
Joined
Feb 21, 2002
Messages
1,885
Have you tried adding the checkbox change into your recordset code ie

Private Sub Command68_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("First Hotel Reg") 'If this is a query, make sure it includes the send and sent email fields
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EMail").Value
DoCmd.SendObject , , , strEmail, , , "AC Pool....
.....Housing Bureau. Numbers/Address on form. Exhibitor badge reg. info. will be forwarded to you within a few weeks", False
rsEmail.Edit
rsEmail("sendemail") = 0
rsEmail("sentemail") = 1
rsEmail.Update
rsEmail.MoveNext
Loop
Set rsEmail = Nothing
end sub

HTH
 

alguzman

Registered User.
Local time
Today, 02:13
Joined
Aug 2, 2001
Messages
63
Thanks for your help Fizzio. I apologize for posting the same questions. Your suggestion works, thanks again.
 

Users who are viewing this thread

Top Bottom