Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Tables / March 2006

Tip: Looking for answers? Try searching our database.

Form rows with CheckBoxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GusEvans - 27 Mar 2006 22:45 GMT
We have a template that contains a table of rows (single column). At the
beginning of each row is a checkbox.  When a new contract is entered, the
form template is opened, client name and file # entered an then saved under
the clients name.  As the contract is worked this form is re-opened and the
various applicable table rows are checked.  When done, the user runs a macro
to close up all unchecked rows.  This works, but results in multiple
unchecked rows looking like thin or not so thin gray lines.  Any suggestions??

TIA
Signature

Gus Evans

Jezebel - 27 Mar 2006 23:09 GMT
Delete the unwanted rows?

> We have a template that contains a table of rows (single column). At the
> beginning of each row is a checkbox.  When a new contract is entered, the
[quoted text clipped - 9 lines]
>
> TIA
GusEvans - 28 Mar 2006 00:23 GMT
Jezebel-
The user wants to check various comments and save them, but to, in the
future, open all rows and re-set the checkmarks to modify the amendment to
the contract.  Then compress unused rows and re-save it.  I have written the
code to do both.

Forgot to mention - their are 2 columns in the table - 1 narrow one for just
Checkboxes and 1 wide one for the comments, fields and other checkboxes.

Signature

Gus Evans

> Delete the unwanted rows?
Jezebel - 28 Mar 2006 04:28 GMT
Use plain text instead of a table, then format the unwanted lines as hidden.
Use a hanging indent for the comment 'column'.

> Jezebel-
> The user wants to check various comments and save them, but to, in the
[quoted text clipped - 8 lines]
>
>> Delete the unwanted rows?
GusEvans - 28 Mar 2006 15:31 GMT
Jezebel-

The user already has a couple of hundred already done - all I need to know
is if there is anyway to effectively compress the unchecked ones with little
or no indication.  So far I am using the following code to do it -

Sub CloseUnChecked()
   Dim intX As Integer
   Dim strRow As String
   Dim vCB As CheckBox

   Application.ScreenUpdating = False
   If ActiveDocument.ProtectionType <> wdNoProtection Then
       ActiveDocument.Unprotect Password:=strPassword
   End If
   For intX = 1 To 26
       strRow = "chkRow" & intX
       Set vCB = ActiveDocument.FormFields(strRow).CheckBox
       If vCB.Value = False Then
           With vCB
               .AutoSize = True
               .Size = 1
           End With
           ActiveDocument.Tables(1).Rows(intX).Select
           With ActiveDocument.Tables(1).Rows(intX)
               .HeightRule = wdRowHeightExactly
               .Height = 1
           End With
       End If
   Next
   ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:=strPassword
End Sub

Signature

Gus Evans

> Use plain text instead of a table, then format the unwanted lines as hidden.
> Use a hanging indent for the comment 'column'.
Greg - 28 Mar 2006 19:28 GMT
Gus,

As Jezebel has suggested.  Why don't you just delete the rows instead
of trying to squish them up.

Try:
Sub DeleteUnChecked()
Dim pRowIndex As Long
Dim pRows As Word.Rows
Application.ScreenUpdating = False
If ActiveDocument.ProtectionType <> wdNoProtection Then
 ActiveDocument.Unprotect
End If
Set pRows = ActiveDocument.Tables(1).Rows
For pRowIndex = pRows.Count To 1 Step -1
 If pRows(pRowIndex).Range.FormFields(1).CheckBox.Value = False Then
   pRows(pRowIndex).Delete
 End If
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
Greg - 28 Mar 2006 19:50 GMT
Gus,

I'm ready.  Go ahead and say it:  "Read the whole question stupid."

Sorry

All I can suggest is maybe continuing your current process to squish
the rows even more and set the borders to nothing.  Here is a bit of
code that I sometimes use to show/hide text in a table:

Dim bGrid As Boolean
Application.ScreenUpdating = False
With ActiveDocument.Tables(1)
 With .Rows(1)
   If .HeightRule = wdRowHeightExactly Then
     .HeightRule = wdRowHeightAuto
     CommandButton1.Caption = "Hide details"
     .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
     .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
     .Borders(wdBorderRight).LineStyle = wdLineStyleSingle
     .Borders(wdBorderTop).LineStyle = wdLineStyleSingle
   Else
     .HeightRule = wdRowHeightExactly
     .Height = ".05"
     CommandButton1.Caption = "Show details"
     .Borders(wdBorderBottom).LineStyle = wdLineStyleNone
     .Borders(wdBorderLeft).LineStyle = wdLineStyleNone
     .Borders(wdBorderRight).LineStyle = wdLineStyleNone
     .Borders(wdBorderTop).LineStyle = wdLineStyleNone
   End If
 End With
End With
Application.ScreenUpdating = True
Jezebel - 29 Mar 2006 00:30 GMT
You've already established that your method doesn't work acceptably. So your
choices are live with it, or do something else. Unless you are particularly
in love with the dead horse?

> Jezebel-
>
[quoted text clipped - 34 lines]
>> hidden.
>> Use a hanging indent for the comment 'column'.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.