![]() |
| 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. |
|
|||||||
| Tags: based, boxes, check, field, form, multiple, outlook, populating, values |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 |