PDA

View Full Version : Solved: Present listbox items as bulleted list in text content control



brent.fraser
12-17-2012, 12:13 PM
Hello,

I am using Microsoft Word 2010 on a PC and I have created a userform that has a listbox is populated based on criteria the user selects. This listbox can have multiple selections. What I would like to do is present this information in a text content control (named pplMgmtDescription) as a bulleted list (really, just insert a & vbNewLine & after each entry).

Here's what I have so far on the UserForm:
Option Explicit
Private Sub CmdBtnCancel_Click()
Me.Hide
End Sub
Private Sub UserForm_Initialize()
Dim strArray() As String
With Me
'this information (pPplMgmtDesc) is gathered depending on a checkbox the user selects. This part is working fine.
.LBmultisel.List = Split(pPplMgmtDesc, "-")
'we now have the listbox and we can select multiple items here
End With
End Sub
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
With ActiveDocument
'here's where I want to now transfer the information in the listbox to the text content control in the form of a bulleted list.
.SelectContentControlsByTitle("pplMgmtDescription").Item(1).Range.Text = .LBmultisel.List
End With
Application.ScreenUpdating = True
Unload Me
End Sub

In the module, I have:

Private Function SelectedContentControl() As ContentControl
Dim oRng As Word.Range
Dim objCC As ContentControl
Dim oCCRichText As ContentControl
Dim oCCNested As ContentControl
Set oRng = Selection.Range.Paragraphs(1).Range
Set SelectedContentControl = Nothing
DoEvents
bTabEntry = True
If GetFocusMethod <> 1 Then bTabEntry = False
For Each objCC In oRng.ContentControls
DoEvents
If Selection.InRange(objCC.Range) Or objCC.Range.End = Selection.Range.End Or objCC.Range.Start = Selection.Range.Start Then
If objCC.Type = wdContentControlRichText Then
Set SelectedContentControl = objCC
If objCC.Range.ContentControls.Count > 0 Then
Set oCCRichText = objCC 'Beep
For Each oCCNested In oCCRichText.Range.ContentControls
DoEvents
If Selection.InRange(oCCNested.Range) Or oCCNested.Range.End = Selection.Range.End Or oCCNested.Range.Start = Selection.Range.Start Then
Set SelectedContentControl = objCC
Exit For
End If
Next oCCNested
Else
Set SelectedContentControl = objCC
Exit For
End If
Else
Set SelectedContentControl = objCC
Exit For
End If
End If
'If the CC tab is physically selected with the mouse.
If Selection.Range.ContentControls.Count = 1 Then
Set SelectedContentControl = Selection.Range.ContentControls(1)
Exit For
End If
If Selection.Range.ContentControls.Count > 0 Then
Set SelectedContentControl = Selection.Range.ContentControls(1)
Exit For
End If
Next objCC
End Function
Function GetFocusMethod() As Integer
DoEvents
'Determine how a control got the focus
If GetKeyState(vbKeyTab) < 0 Then
If (GetKeyState(vbKeyShift) < 0) Then
'Shift-Tab key is pressed
GetFocusMethod = 4
Else
'Tab key is pressed
GetFocusMethod = 1
End If
ElseIf GetKeyState(vbKeyMenu) < 0 Then
'Alt key is pressed (hotkey activation)
GetFocusMethod = 2
ElseIf GetKeyState(vbKeyLButton) < 0 Then
'Mouse left button is pressed
GetFocusMethod = 3
End If
End Function


This is a Frankenstein of many vba pieces I have tried to piece together and make work. Soon, I would like to be able to say "it's alive" but not yet.

As always, thank you in advance.

B.

brent.fraser
12-17-2012, 01:28 PM
Here's a w.i.p of the document in case there is more information needed.

As I have said, it's sort of a frankenstein of code. Not elegant but I am not a programmer.

B.

gmaxey
12-17-2012, 02:26 PM
Brent,

You need to clean up your code a little before anyone offering "free" support is going to be of much help.

As a start, if you want to build a string from items selected in a listbox then you will either have to build that string in the Userform module or leave the form in memory until you build it later in another module. As it is now, you are unloading the form from memory when the user clicks "OK."

I've come back to edit this because I don't want you to think that I don't want to help. I do want to help, but I don't want to do it for you.
In fairness to you, you've opted to start with a pretty advanced project. I still have scars from my foray into the pseudo content control change events :(

If I was in your place I would try separate the simple from the complex. E.g., how do I write the collective selected listbox items to a CC:

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strText As String
Dim oCC As ContentControl
Set oCC = ActiveDocument.SelectContentControlsByTitle("DemoRTCC").Item(1)
'The collection of all things selected in the listbox:
strText = "Like Apples|Likes Peaches|Likes Pears"
strText = Replace(strText, "|", Chr(11))
oCC.Range.Text = strText
End Sub

brent.fraser
12-17-2012, 03:23 PM
Thanks for the tips Greg.

So I am no longer unloading the form with an "Unload Me" but hiding it (as you used in a document I downloaded - student survey).

Option Explicit
Private Sub CmdBtnCancel_Click()
Me.Hide
End Sub
Private Sub UserForm_Initialize()
Dim strArray() As String
With Me
.LBmultisel.List = Split(pPplMgmtDesc, "-")
End With
End Sub
Private Sub cmdOK_Click()
Me.Hide
End Sub

I am looking at what you did when you put the list of favorite sports onto the page and how you "clean them up."

I looked at your example and this is what I have done:

Sub CallUF()
Dim oFrm As UserForm1
Dim oVars As Word.Variables
Dim strTemp As String
Dim i As Long
Dim strMultiSel As String
Set oFrm = New UserForm1
With oFrm
.Show
If .boolProceed Then
strMultiSel = ""
With .LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & "& vbNewLine &"
End If
Next i
End With
'Clean up the string text.
If Right(strMultiSel, 2) = ", " Then strMultiSel = Left(strMultiSel, Len(strMultiSel) - 2) & "."
On Error Resume Next
strMultiSel = Left(strMultiSel, InStrRev(strMultiSel, ",") - 1) & " and" & Mid(strMultiSel, InStrRev(strMultiSel, ",") + 1)
On Error GoTo 0
If strMultiSel = "None Above Apply" Then strMultiSel = "Please see Additional Comments below for more information."
.SelectContentControlsByTitle("pplMgmtDescription").Item(1).Range.Text = strMultiSel
'oVars("varFavSports").Value = strMultiSel
UpdateThisFormsFields
Else
MsgBox "Form cancelled by user"
End If
End With
Unload oFrm
'Set oFrm = Nothing
End Sub

Is this what you mean by cleaning it up?

Also, for building the string od items in the listbox, where is the most logical place to do it? In the Userform or in a module?

Thanks again.

Brent

gmaxey
12-17-2012, 03:32 PM
Brett,

By cleaning it up, I mean getting your head around what code is doing what.
As best I can tell CallUF is not even part of the equation. It seemed to me that the form is being called with UserForm1.Show in one of the other procedrues ("I'm not looking at the code right now.).

brent.fraser
12-17-2012, 03:50 PM
Greg,

As a little background, I am working on a form for Human Resources for an employee evaluation. There are six categories and five ratings in each category. What I have been asked to do is create an interactive form where the user will pick one of the categories (option/checkbox). Then, they will get a listbox in a Userform that appears with "choices" in it. The user will select multiple items (if any) and that information will be added to the form in bullet form. Then the user can add their personal comments to the form to go along with the ones chosen in the listbox.

As I am not a VBA programmer (I can do a bit with help), this has been taxing to say the least. I have some of the elements working like having the listbox elements populate based on the "checkbox/option" buttons I have created. I just need to figure out how to get the information to the actual form and that's where I am stuck.

I know that you are helping and I appreciate it very much. I have been looking as much as possible for answers and examples and when I hit a road-block, that's when I solicit help. I have been creeping your site and downloading as many examples as I could get my hands on.

For your comment on the CallUF above, it's something I found in one of your examples that works in one of your documents. In it is how you clean up the listbox items so it can be put into the form and that's what I am trying to do......

For the userform1 to be viewed, it's when one of the "checkbox/option" buttons changes. That then makes the userform appear with the listbox for the user to select the items in it.

My deadline for this "pretty advanced project" is before the end of the week at the latest.... merry christmas HR people.... haha.

Thanks for the assistance Greg.

B.

gmaxey
12-17-2012, 04:13 PM
Brent,

I know that you have used some of my code. The problem is that simply putting it in your project doesn't make is work. Add a stop statement to the CallUF procedure as shown below. Then start tinkering with your document. Notice that you never reach the stop because you are calling the form in another procecure!

With oFrm
Stop
.Show
If .boolProceed Then

brent.fraser
12-17-2012, 04:31 PM
I got the

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strText As String
Dim oCC As ContentControl
Set oCC = ActiveDocument.SelectContentControlsByTitle("DemoRTCC").Item(1)
'The collection of all things selected in the listbox:
strText = "Like Apples|Likes Peaches|Likes Pears"
strText = Replace(strText, "|", Chr(11))
oCC.Range.Text = strText
End Sub

to work so that's a good example. I replaced the Chr(11) with a vbNewLine. I now know what I can do when I transfer the selected items over. Replace the "|" with a "-" I have used to separate the items and have them populate the content control. Thumbs up.

Now, working on how to pass the selected items onto the example above. Work in progress.....

I also see that I don't get to the CallUF function because 1) I haven't called it and 2) yes, I invoke the userform when someone selects a checkbox. I am trying to figure out how/where to add your clean-up code. I am thinking I should do it in the form? Seems to be a logical place doesn't it?

thanks again!

gmaxey
12-17-2012, 05:12 PM
See attached.

brent.fraser
12-18-2012, 10:19 AM
Wow Greg, you nailed it right on the head. Exactly what I needed. Thank you sooooooooo incredibly much! I hope you didn't spend too much time on it.

I am just adding some error correction to make sure the people select at least one choice and we are good to go.

Thanks also for putting in the comments. It sure has helped me getting to know what's going on.

You are a saviour.

Thank you again Greg.

gmaxey
12-18-2012, 10:32 AM
Saviour? How about hungry:tongue2:

brent.fraser
12-18-2012, 12:36 PM
well it was just after lunch time when you posted that, so hungry is a viable option for you.

hope you had a good lunch.

Not sure if you want to see the final product when I am done but if you want to, I can send it to you.

Thanks again.

Brent

P.S. My uncle was in the Canadian Navy for many years. Had many hours on his battleship on Vancouver Island growing up.

brent.fraser
12-18-2012, 03:41 PM
I am not sure if anyone is into troubleshooting but here's an interesting one......

The attached form seems to work well. You select an option button, pick some items from the list and it gets posted to the form.

What's whacky is when you go to type in the "additional comments" area, the area above with the bulleted list disappears and I don't know why......

Also, when someone else tries to run the file on their machine, they get an error that says it can't load the object because it isn't on their machine but it doesn't say what object.

it has been a fun ride.......

Brent

gmaxey
12-18-2012, 04:01 PM
Brent,

Hungry could mean that I need money to buy food? Besides I've been giving you the fish for the last few days.

As I've tried to tell you, you picked a very fickle processs get your feet wet with. The ContentControl OnChange event was more "proof of concept" than "production run." I'm not surprised that you are finding hair balls.

You will discover why your text disappears if you study and learn how your Custom_ContentControlChange event works. It is doing exactly what you have it coded to do (or rather what I have it coded to do). If you want it to do something else then you need to write the appropriate code.

Hint: Put a breakpoint in the procedure and step through the code after you hit the breakpoint.

Otherwise it seems to work fine.

brent.fraser
12-18-2012, 04:32 PM
I think I have to tell it what content controls to watch and which ones not to. The user comments do not need to be watched for changes while the option buttons do.

Thanks again for being the compass on this crazy trip.

brent.fraser
12-18-2012, 06:46 PM
Hey Greg,

Now that the scope has changed a bit with the list box userform needing to be displayed displayed when an option button is checked, I don't think I need any more of the monitoring of the content controls so I am toying with scrapping what I have since, as you said, I have encountered a couple of "hairballs" that I wasn't anticipating.

Al thoug the monitoring when the content controls change is pretty cool, I don't need that in this revision. Originally when the radio/option button was checked, the bulleted list would appear, but now HR wants the user to pick from the list and have that in the form.....

Never ending fun huh?

Thank you again for your assistance. I hope one day it's done..... haha.


Ciao for now.

Brent :bug:

brent.fraser
12-20-2012, 08:54 AM
Hey Greg,

I don't think I want to scrap everything because it is working well.

Do you think something like the following would work?

In the Custom_ContentControlOnChange, add the following for all the cc's I want to lock?


If pplMgmtDescription <> "" then
.lockContents = True
Else
.lockedContents = False
End if


I had an epiphany at 1:00 AM in my sleep..... maybe it will work, maybe not. I am going to try to give it a go. My reasoning is that if the cc has content (populated from the listbox form), we don't want it to disappear so we lock it. If it is empty, we can unlock it and we are all happy? When the user selects the content/checkbox option, it will then invoke the form and unlock the cc and we are off to the races again?????

maybe.....

brent.fraser
12-20-2012, 09:23 AM
A little more refining:

Dim oCC_pplMgmtDescription As ContentControl
Set oCC_pplMgmtDescription = ActiveDocument.SelectContentControlsByTag("pplMgmtDescription").Item(1)
With oCC_pplMgmtDescription
If .Range.Text <> "" Then
.LockContents = True
Else
.LockedContents = False
End If
End With

Am I onto something? I think it should work. Just figuring out correct syntax and the right place to place it.

hope you are doing well. Santa is almost here!!!! YAY!!!!

gmaxey
12-20-2012, 10:28 AM
brent,

Just looking at the file that you attached earlier, I would probably a) consolidate the code some (but I don't have time), and b) append to the existing pseudo OnChange event the as follows:

Public Sub Custom_ContentControlOnChange(oCC_Changed As ContentControl)
Dim oCC_Target As ContentControl
Dim pStatus As String
Dim strMultiSel As String
Dim i As Long
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PEOPLE MANAGEMENT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim oCC_pplUnsat As ContentControl
Set oCC_pplUnsat = ActiveDocument.SelectContentControlsByTag("pplUnsat").Item(1)
Dim oCC_pplNeedImp As ContentControl
Set oCC_pplNeedImp = ActiveDocument.SelectContentControlsByTag("pplNeedImp").Item(1)
Dim oCC_pplMeets As ContentControl
Set oCC_pplMeets = ActiveDocument.SelectContentControlsByTag("pplMeets").Item(1)
Dim oCC_pplExceeds As ContentControl
Set oCC_pplExceeds = ActiveDocument.SelectContentControlsByTag("pplExceeds").Item(1)
Dim oCC_pplExcept As ContentControl
Set oCC_pplExcept = ActiveDocument.SelectContentControlsByTag("pplExcept").Item(1)
'********************************People Management Unsatisfactory **************************************
Select Case oCC_Changed.Tag
Case "pplUnsat"
If oCC_pplUnsat.Checked = True Then
oCC_pplNeedImp.Checked = False
oCC_pplMeets.Checked = False
oCC_pplExceeds.Checked = False
oCC_pplExcept.Checked = False
End If
If oCC_Changed.Checked = True Then
'This is the rating definition.
'pStatus = "Unsatisfactory"
'pPplMgmtStatus = pStatus
pPplMgmtStatus = "Unsatisfactory"
pPplMgmtDesc = "Rarely engages with team to observe and discuss performance and goals, does not coach for improved performance; believes employees should know what to do-Is unaware of Toyo’s vision, mission and goals; speaks negatively about the company-Is negative about providing coaching and training; does not see the need or value of training and development-Focuses more on failure to achieve desired results; does not assume any accountability for poor outcomes-Assigns work inappropriately; does not keep development and performance goals in mind; has unrealistic expectations and perception of staff skills and knowledge-Has minimal or no impact on accountability of team members to produce quality work"
'Here is where you show the form
PplMgmt.Show
'Build the string.
With PplMgmt.LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & Chr(13)
End If
Next i
If strMultiSel = "" Then
strMultiSel = "See additional comments below."
Else
strMultiSel = Left(strMultiSel, Len(strMultiSel) - 1)
End If
End With
'Kill the form.
Unload PplMgmt
Else
'pStatus = ""
pPplMgmtStatus = "People Management Status"
strMultiSel = "People Management Criteria"
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ People Management Needs Improvement ~~~~~~~~~~~~~~~~~~~~~~
Case "pplNeedImp"
If oCC_pplNeedImp.Checked = True Then
oCC_pplUnsat.Checked = False
oCC_pplMeets.Checked = False
oCC_pplExceeds.Checked = False
oCC_pplExcept.Checked = False
End If
If oCC_Changed.Checked = True Then
'This is the rating definition.
'pStatus = "Needs Improvement"
'pPplMgmtStatus = pStatus
pPplMgmtStatus = "Needs Improvement"
pPplMgmtDesc = "Inconsistent in supporting team to achieve defined performance goals; Coaches intermittently usually to correct mistakes or give negative feedback-Has some understanding of Toyo’s vision, mission and goals; does not communicate with team members on this matter-Provides only essential training to team members; does not do an assessment on their training needs-Infrequently recognizes and rewards success; doesn’t interact with team frequently enough to identify and recognize achievements-Doesn’t effectively match work assignments to team member’s skills and knowledge-Doesn’t consistently hold team members accountable for their delivery, on time, on budget or quality of work"
'Here is where you show the form
PplMgmt.Show
'Build the string.
With PplMgmt.LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & Chr(13)
End If
Next i
If strMultiSel = "" Then
strMultiSel = "See additional comments below."
Else
strMultiSel = Left(strMultiSel, Len(strMultiSel) - 1)
End If
End With
'Kill the form.
Unload PplMgmt
Else
'pStatus = ""
pPplMgmtStatus = "People Management Status"
strMultiSel = "People Management Criteria"
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ People Management Meets Expectations ~~~~~~~~~~~~~~~~~~~~~~
Case "pplMeets"
If oCC_pplMeets.Checked = True Then
oCC_pplUnsat.Checked = False
oCC_pplNeedImp.Checked = False
oCC_pplExceeds.Checked = False
oCC_pplExcept.Checked = False
End If
If oCC_Changed.Checked = True Then
'This is the rating definition.
'pStatus = "Meets Expectations"
pPplMgmtStatus = "Meets Expectations"
'pPplMgmtStatus = pStatus
pPplMgmtDesc = "Coaches team members to achieve performance and development goals-Communicates with team members regarding vision, mission and goals; demonstrates support to achieve these-Checks for gaps in knowledge and provides training to meet those gaps that are necessary-Fairly and consistently recognizes and rewards specific individual and team accomplishments-Thoughtfully delegates work to develop staff and achieve goals-Checks with and holds team members accountable to deliver work on schedule, on budget and on time"
'Here is where you show the form
PplMgmt.Show
'Build the string.
With PplMgmt.LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & Chr(13)
End If
Next i
If strMultiSel = "" Then
strMultiSel = "See additional comments below."
Else
strMultiSel = Left(strMultiSel, Len(strMultiSel) - 1)
End If
End With
'Kill the form.
Unload PplMgmt
Else
'pStatus = ""
pPplMgmtStatus = "People Management Status"
strMultiSel = "People Management Criteria"
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ People Management Exceeds Expectations ~~~~~~~~~~~~~~~~~~~~~~
Case "pplExceeds"
If oCC_pplExceeds.Checked = True Then
oCC_pplUnsat.Checked = False
oCC_pplNeedImp.Checked = False
oCC_pplMeets.Checked = False
oCC_pplExcept.Checked = False
End If

If oCC_Changed.Checked = True Then
'This is the rating definition.
'pStatus = "Exceeds Expectations"
pPplMgmtStatus = "Exceeds Expectations"
'pPplMgmtStatus = pStatus
pPplMgmtDesc = "Encourages and engages staff to achieve performance and development goals, recommends opportunities for team to expand and enhance skills; encourages creative solutions-Is aware of what Toyo has to offer; speaks to team members positively and motivates them to achieve the vision, mission and goals-Routinely provides training and development opportunities to all team members; assesses gaps in knowledge on a consistent basis-Routinely recognizes and commends improved performance; celebrates successful completion of team efforts-Effectively links work assignments to achieve individual and department performance goals-Effectively follows up with team members to ensure delivery of quality work, on budget and on time"
'Here is where you show the form
PplMgmt.Show
'Build the string.
With PplMgmt.LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & Chr(13)
End If
Next i
If strMultiSel = "" Then
strMultiSel = "See additional comments below."
Else
strMultiSel = Left(strMultiSel, Len(strMultiSel) - 1)
End If
End With
'Kill the form.
Unload PplMgmt
Else
'pStatus = ""
pPplMgmtStatus = "People Management Status"
strMultiSel = "People Management Criteria"
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ People Management Exceptional ~~~~~~~~~~~~~~~~~~~~~~
Case "pplExcept"
If oCC_pplExcept.Checked = True Then
oCC_pplUnsat.Checked = False
oCC_pplMeets.Checked = False
oCC_pplExceeds.Checked = False
oCC_pplNeedImp.Checked = False
End If

If oCC_Changed.Checked = True Then
'This is the rating definition.
'pStatus = "Exceptional"
pPplMgmtStatus = "Exceptional"
'pPplMgmtStatus = pStatus
pPplMgmtDesc = "Leads and motivates by example; coaches team to ensure optimal productivity; fosters a creative, innovative and supportive workplace-Tries to come up innovative ways to support Toyo in achieving their goals; has a continuing dialog with team members about the company’s vision, mission and goals-Goes above and beyond to look for new, innovative methods of training and development to improve performance-Consistently and effectively acknowledges the team member’s initiative to improve skills and enhance contributions; thanks team for ‘above and beyond’ accomplishments-Effectively delegates work to develop skills and knowledge; ensure optimal outcomes; aligns work with individual, department and organizational goals-Diligently follows up with team members to ensure quality work, on budget and on time; provides coaching and mentoring to make improvements"
'Here is where you show the form
PplMgmt.Show
'Build the string.
With PplMgmt.LBmultisel
For i = 0 To .ListCount - 1
If .Selected(i) Then
strMultiSel = strMultiSel & .List(i) & Chr(13)
End If
Next i
If strMultiSel = "" Then
strMultiSel = "See additional comments below."
Else
strMultiSel = Left(strMultiSel, Len(strMultiSel) - 1)
End If
End With
'Kill the form.
Unload PplMgmt
Else
'pStatus = ""
pPplMgmtStatus = "People Management Status"
strMultiSel = "People Management Criteria"
End If
End Select
Select Case oCC_Changed.Tag
Case "pplUnsat", "pplNeedImp", "pplMeets", "pplExceeds", "pplExcept"
ActiveDocument.SelectContentControlsByTitle("pplMgmtComments").Item(1).Range.Text = ""
'Put the data in the CC.
Set oCC_Target = ActiveDocument.SelectContentControlsByTitle("pplMgmtDescription").Item(1)
With oCC_Target
.LockContents = False
.Range.Text = strMultiSel
.LockContents = True
End With
Set oCC_Target = ActiveDocument.SelectContentControlsByTag("pplMgmtStatus").Item(1)
With oCC_Target
.LockContents = False
.Range.Text = pPplMgmtStatus
.LockContents = True
End With
Case Else
'Do nothing
End Select
Set oCC_Target = Nothing
End Sub

gmaxey
12-21-2012, 04:01 PM
Brent,

The beginnings of a more generic template is loaded here:
https://dl.dropbox.com/u/64545773/Company%20Performance%20Appraisal.dotm

From the very beginning there was something not quire right about your monitor event and I have been spending far too much time today trying to figure it out. Still, I am completely stumped.

The event should fire when you 1) Click in the CC checkbox (because that changes the state), and 2) If you toggle the state while you are in the CC.

Yours was doing the first part but not the second. I did discover the reason yours isn't working is because you changed the default check and uncheck symbols in the CC.

But that doesn't answer "why" and sitting here in clumps of hair and bloody scalp, I can't for the life of me figure out why.

I'm going to open an new thread and see if one of the smart guys that visit this forum can work it out.

gmaxey
12-21-2012, 05:49 PM
Brent,

I think I've found something that works just as well:
http://www.vbaexpress.com/forum/showthread.php?t=44813

brent.fraser
01-10-2013, 11:58 AM
Hey Greg,

Thank you so incredibly much for your help.

Attached is the form (still populating the sections) and it works wonderfully.

You are awesome!

I hope you had a great Christmas and New Year's!

Thank you so much again!!!

Brent

gmaxey
01-10-2013, 12:20 PM
Brent,

Glad I could help. I may have had a much fun as you had frustrations ;-)