[AccessD] Multiple Checkboxes

Sad Der accessd666 at yahoo.com
Mon Sep 22 08:44:49 CDT 2003


here you go.

there is a little bug with the delimiter

Function AddEMail(strCurrentEmail As String,
strCurrDep As String, g_strDelimiter As String) As
String
    Dim strNewEMail As String
    
    If strCurrentEmail = vbNullString Then
        strCurrentEmail = strCurrDep
    Else
        strCurrentEmail = strCurrentEmail &
strDelimiter & strCurrDep
    End If
    
    AddEMail = strCurrentEmail
End Function

Function CheckDep(strCurrentDep As String) As String
    Select Case strCurrentDep
        Case "A"
            CheckDep = "a at mycomp.com"
        Case "B"
            CheckDep = "b at mycomp.com"
        Case Else
    End Select
End Function

Private Sub Command_Click()
Dim strEmail As String
Dim strDep As String

strEmail = vbNullString

If Check1 Then
    strDep = CheckDep("A")
    strEmail = AddEMail(strEmail, strDep, ";")
End If

If Check2 Then
    strDep = CheckDep("B")
    strEmail = AddEMail(strEmail, strDep, ";")
End If

MsgBox "You're email is: " & strEmail

End Sub

--- Terri Jarus <jarus at amerinet-gpo.com> wrote:
> 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.>
_______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


More information about the AccessD mailing list