A Microsoft Office (Excel, Word) forum. OfficeFrustration

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 » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form rows with CheckBoxes



 
 
Thread Tools Display Modes
  #1  
Old March 27th, 2006, 10:45 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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
--
Gus Evans
  #2  
Old March 27th, 2006, 11:09 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

Delete the unwanted rows?


"GusEvans" wrote in message
...
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
--
Gus Evans



  #3  
Old March 28th, 2006, 12:23 AM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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.

--
Gus Evans


"Jezebel" wrote:

Delete the unwanted rows?


  #4  
Old March 28th, 2006, 04:28 AM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

Use plain text instead of a table, then format the unwanted lines as hidden.
Use a hanging indent for the comment 'column'.





"GusEvans" wrote in message
...
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.

--
Gus Evans


"Jezebel" wrote:

Delete the unwanted rows?




  #5  
Old March 28th, 2006, 03:31 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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

--
Gus Evans


"Jezebel" wrote:

Use plain text instead of a table, then format the unwanted lines as hidden.
Use a hanging indent for the comment 'column'.


  #6  
Old March 28th, 2006, 07:28 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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.Valu e = False Then
pRows(pRowIndex).Delete
End If
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub

  #7  
Old March 28th, 2006, 07:50 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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

  #8  
Old March 29th, 2006, 12:30 AM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Form rows with CheckBoxes

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?



"GusEvans" wrote in message
...
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

--
Gus Evans


"Jezebel" wrote:

Use plain text instead of a table, then format the unwanted lines as
hidden.
Use a hanging indent for the comment 'column'.




 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls disappear from Data Entry form Paul Ponzelli Using Forms 10 February 26th, 2006 05:51 AM
Date range on reports Mark_Milly Setting Up & Running Reports 10 January 19th, 2006 03:49 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Strange stLinkCriteria behaviour on command button Anthony Dowd Using Forms 3 August 21st, 2004 03:01 AM


All times are GMT +1. The time now is 12:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.