[AccessD] Multiple Checkboxes

Terri Jarus jarus at amerinet-gpo.com
Mon Sep 22 10:25:18 CDT 2003


Thanks for all the suggestions.  Bobby's suggestion is most in line with what I'm trying to do.  And, I just tried it and it works.  I had to make it more complex, though, as the fields are on a subform, but I got it.
 
Thanks again to everyone.
 
Terri Jarus
Director, Contract Support Services
jarus at amerinet-gpo.com
314-542-1902
 
>>> bheid at appdevgrp.com 09/22/03 08:38AM >>>

Hi Terri,
 
In your situation, what I do is name the check boxes serially.  Like chkRecip1,chkRecip2,...chkRecip1N.
 
Then I would loop though them and process then that way.
 
Air code:
 
'you could use a select statement like
for i=1 to 4
     if me("chkRecip" & i) then
           select case i
                case 1
                     checked_Admin = "MS at email.com"
                case 2
                            checked_Admin = "LB at email.com"
                case 3
                     checked_Admin = "#5 at email.com"
                 case 4
                     checked_Admin = #4 at email.com 
                     end select
            SendMail checked_Admin    'function to send the mail
            end if
       next i
 
' or you could set up an array of e-mail addresses first
 
dim strAddr(3)
 
      strAddr(0)="MS at email.com"
      strAddr(1)="MS2 at email.com"
      strAddr(2)="MS3 at email.com"
      strAddr(3)="MS4 at email.com"
 
    for i=1 to 4
         if me("chkRecip" & i) then
             SendMail strAddr(i)
             end if
       next i
 
Hope this helps,
Bobby





-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Terri Jarus
Sent: Monday, September 22, 2003 9:15 AM
To: accessd at databaseadvisors.com 
Subject: [AccessD] Multiple Checkboxes


I have four checkboxes, which if checked, determine who receives an email.  More than one checkbox may be selected.  How do I code this so that all the applicable recipients are emailed?
 
Example - four checkboxes  - MS, PH, LB, NF
 
If MS is checked - Admin = "MS at email.com"
If LB is checked - Admin = LB at email.com 
 
But what if MS and LB are both checked?  How do I word this?
 
I am having a brain cramp on this.  Can't use Select Case because each check box is a unique field - right?
 
If someone can point me in the right direction, I would appreciate the help.
 
Thanks.
 
 
 
Terri Jarus
Director, Contract Support Services
jarus at amerinet-gpo.com 
314-542-1902

---------------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individuals or entities to whom they
are addressed. If you have received this email in error please return 
it to the sender, and erase any copies thereof.


   Copyright 2003 AmeriNet 1nc. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030922/b50706e5/attachment-0001.html>


More information about the AccessD mailing list