A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , , , , , , ,

Populating the to field based on values of multiple check boxes on the outlook form





 
 
Thread Tools Display Modes
  #1  
Old August 31st 07, 12:41 PM posted to microsoft.public.outlook.program_forms
jay.tabatabai@gmail.com
external usenet poster
 
Posts: 2
Default Populating the to field based on values of multiple check boxes on the outlook form

Hello to all outlook form experts out there;

I am a total newbie to Outlook forms programming and have been
challenged with creating a form with 3 checkboxes ( LA , LV and CH )
to be able to construct the "To" field. For instance, if all three
are checked, the "To" field would be "LA; LV; CH". This
functionality will need to work for all permutations of checkbox
selection possibilities.



Various Permutations:

LA Checkbox = True
LV Checkbox = True
CH Checkbox = True

Then the value in To field will be ; ;


If
LA Checkbox = True
LV Checkbox = True
CH Checkbox = False

Then the value in To field will be
;

& .............

Are there any code examples for creating a form similar to what I have
been tasked with.

I will appreciate any guidance and/or advice that can put me on the
right track.

Ads
  #2  
Old September 12th 07, 03:46 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Populating the to field based on values of multiple check boxes on the outlook form

The details will depend on whether you're using bound or unbound controls; see http://www.outlookcode.com/article.aspx?ID=38 for basic syntax for both.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


wrote in message oups.com...
Hello to all outlook form experts out there;

I am a total newbie to Outlook forms programming and have been
challenged with creating a form with 3 checkboxes ( LA , LV and CH )
to be able to construct the "To" field. For instance, if all three
are checked, the "To" field would be "LA; LV; CH". This
functionality will need to work for all permutations of checkbox
selection possibilities.



Various Permutations:

LA Checkbox = True
LV Checkbox = True
CH Checkbox = True

Then the value in To field will be ; ;


If
LA Checkbox = True
LV Checkbox = True
CH Checkbox = False

Then the value in To field will be
;

& .............

Are there any code examples for creating a form similar to what I have
been tasked with.

I will appreciate any guidance and/or advice that can put me on the
right track.

  #3  
Old September 23rd 07, 08:03 PM posted to microsoft.public.outlook.program_forms
jay.tabatabai@gmail.com
external usenet poster
 
Posts: 2
Default Populating the to field based on values of multiple check boxes on the outlook form

On Sep 12, 6:46 am, "Sue Mosher [MVP-Outlook]"
wrote:
The details will depend on whether you're using bound or unbound controls; seehttp://www.outlookcode.com/article.aspx?ID=38for basic syntax for both.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



wrote in ooglegroups.com...
Hello to all outlook form experts out there;


I am a total newbie to Outlook forms programming and have been
challenged with creating a form with 3 checkboxes ( LA , LV and CH )
to be able to construct the "To" field. For instance, if all three
are checked, the "To" field would be "LA; LV; CH". This
functionality will need to work for all permutations of checkbox
selection possibilities.


Various Permutations:


LA Checkbox = True
LV Checkbox = True
CH Checkbox = True


Then the value in To field will be ; ;


If
LA Checkbox = True
LV Checkbox = True
CH Checkbox = False


Then the value in To field will be ;


& .............


Are there any code examples for creating a form similar to what I have
been tasked with.


I will appreciate any guidance and/or advice that can put me on the
right track.- Hide quoted text -


- Show quoted text -


Thanks for your reply,
I looked at the reference material but for some reason , added it to
the form's script editor but could not make the click event respond
Item_PropertyChange(ByVal Name) , and not sure what I was doing wrong.

However I managed to make the form work using the code below.
---------------------------------
LA = 0
LV = 0
CH = 0

Sub CheckBox_LA_Click()
If LA = 0 Then
LA = 1
Else
LA = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub

Sub CheckBox_LV_Click()
If LV = 0 Then
LV = 1
Else
LV = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub

Sub CheckBox_CH_Click()
If CH = 0 Then
CH = 1
Else
CH = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub





  #4  
Old September 24th 07, 01:26 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Populating the to field based on values of multiple check boxes on the outlook form

You didn't say whether you are working with bound or unbound controls. As the article I suggested explains, that determines which events are available. The fact that you got a Click event to work indicates that the check box is unbound. FYI, for your logic, it would be better to use True and False instead of 1 and 0.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


wrote in message ups.com...
On Sep 12, 6:46 am, "Sue Mosher [MVP-Outlook]"
wrote:
The details will depend on whether you're using bound or unbound controls; seehttp://www.outlookcode.com/article.aspx?ID=38for basic syntax for both.

wrote in ooglegroups.com...
Hello to all outlook form experts out there;


I am a total newbie to Outlook forms programming and have been
challenged with creating a form with 3 checkboxes ( LA , LV and CH )
to be able to construct the "To" field. For instance, if all three
are checked, the "To" field would be "LA; LV; CH". This
functionality will need to work for all permutations of checkbox
selection possibilities.


Various Permutations:


LA Checkbox = True
LV Checkbox = True
CH Checkbox = True


Then the value in To field will be ; ;


If
LA Checkbox = True
LV Checkbox = True
CH Checkbox = False


Then the value in To field will be ;


& .............


Are there any code examples for creating a form similar to what I have
been tasked with.


I will appreciate any guidance and/or advice that can put me on the
right track.- Hide quoted text -


- Show quoted text -


Thanks for your reply,
I looked at the reference material but for some reason , added it to
the form's script editor but could not make the click event respond
Item_PropertyChange(ByVal Name) , and not sure what I was doing wrong.

However I managed to make the form work using the code below.
---------------------------------
LA = 0
LV = 0
CH = 0

Sub CheckBox_LA_Click()
If LA = 0 Then
LA = 1
Else
LA = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub

Sub CheckBox_LV_Click()
If LV = 0 Then
LV = 1
Else
LV = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub

Sub CheckBox_CH_Click()
If CH = 0 Then
CH = 1
Else
CH = 0
End If

To_Text = ""
If LA = 1 Then
To_Text = "
End If

If LV = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

If CH = 1 Then
If To_Text "" Then
To_Text = To_Text & "
Else
To_Text = "
End If
End If

Item.To = To_Text
End Sub


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unchecked Check Boxes JoeyB Outlook - Using Forms 2 February 24th 07 02:51 PM
Creating a value with Check Boxes. Splitcom Outlook - Using Forms 1 August 5th 06 01:13 AM
Check Boxes in a custom view DoubleDown Outlook - Using Forms 0 July 3rd 06 09:02 PM
Having some difficulties with check boxes Jules815 Outlook - Using Forms 2 May 11th 06 07:15 PM
Populating CC field from dropdown box. Operation failed error on s Yvetta Outlook - Using Forms 9 April 7th 06 07:28 PM


All times are GMT +1. The time now is 01:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Mortgage - Loans - Loans - Remortgages - Cingular Ringtones