Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Repeat Completed Rows (Word 2003)

    Good Morning,

    I have a form that users can complete (example attached) and I would like to know if it is possible to have the first/second row "Cooking Sheet" and "Date" repeat at the top of the next page and the "Chef Information" rows repeat at the bottom of the next page. The row header repeat function repeats the entire 2nd row when all I need is the date. What happens now is when people type in their recipe and the field expands to the next page it only carries over the Chef information. I need that information to stay on the first page and also be carried over to the 2nd page. Any ideas? Is this even possible?

    Thank you,
    SME
    Attached Files Attached Files

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Repeat Completed Rows (Word 2003)

    Heading Rows, as the name implies, duplicate entire rows. Although a REF field can duplicate text from any form field or other bookmark, it's not clear how you can use this without the duplicated information also appearing on the first page an extra time (e.g., in the top row). Perhaps there is a tricky way to do it by comparing the position of the REF field with the bookmark/form field, but that level of field wizardry is beyond my powers.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repeat Completed Rows (Word 2003)

    It's not easy to repeat just part of a row. And although Word has a Heading Rows Repeat feature, it doesn't have a counterpart for bottom rows. I'd put the information you want on every page in the page header and page footer. See <post#=259,183>post 259,183</post#> for a demo - it employs a userform to set document variables, and the page header contains DOCVARIABLE fields that display the value of these variables.

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Repeat Completed Rows (Word 2003)

    With other similar requirements I have put ONLY the repeating information in the top row, and I have then created a text box, anchored outside the table, that covers part of the first row on the first page and includes the information that needs to be different.

    This won't work for your solution since you can't put those fields in a floating text box.

    StuartR

  5. #5
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    Thank you all for your great suggestions and insight! I will be testing out all of the suggestions throughout the week and will let you know how it goes. =). Again, Thank you!

    Warm Regards,
    SME

  6. #6
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    HansV. your reference to post 25913 was very helpful but I'm stuck. How can I change the "Subject" and "Info" text to read "Cook Name" and "Date" in the little box that pops up when I start word?

    Thank you,
    SME

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repeat Completed Rows (Word 2003)

    Activate the Visual Basic Editor (Alt+F11).
    If you don't see the Project Explorer (resembling the left hand pane of Windows Explorer), press Ctrl+R
    If you don't see the Properties window or pane, press F4.
    Locate the template in the Project Explorer on the left.
    If necessary, expand it until you see frmSettings under Forms.
    Double click frmSettings.
    You'll see the form in design view.
    Click on the word Subject.
    You'll see in Properties that it is a Label.
    You can change the text it displays by editing its Caption property (see screenshot below).
    The label also shows an underlined letter, meaning that you can activate the corresponding text box by pressing Alt+that letter.
    When you change the caption, you'll also want to change the underlined letter, by editng the Accelerator property.

    You can resize the form by clicking in an empty part of the form, then dragging one of the 'handles' in the bottom or right edge.
    You can use the Toolbox to add more controls such as text boxes and labels.
    Attached Images Attached Images
    • File Type: png x.png (11.9 KB, 1 views)

  8. #8
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    Thanks for your help. I've been working on my form all day and have figured out how to do most of the things you are referring to Hans. Your template in the other post, was very, very helpful. But, I'm stuck again. When I apply the Open Forms Macro used in your template it does not display the userform I created (I alos don't have the settings option in the tools section). I've attached a copy of the VBA screen to show you the macro and my userform. Any help would be great!

    Thank you,
    SME
    Attached Files Attached Files

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repeat Completed Rows (Word 2003)

    You have given the module and the macro it contains the same name (ShowForm). This is confusing to VBA. You should give the module another name, for example basShowForm.
    Does that help?

    To create a custom menu item, toolbar button and/or keyboard shortcut, you must select Tools | Customize in Word.
    For a menu item or toolbar button:
    - Activate the Commands tab.
    - Select your template in the 'Save in' dropdown (this is important!)
    - Select Macros in the list of Categories on the left.
    - Select ShowForm (with its prefixes) in the list of macros on the right.
    - Drag it to a convenient location on a toolbar or menu (menus will drop down if you hover the mouse pointer over them)
    For a keyboard shortcut:
    - Click the Keyboard... button.
    - Select your template in the 'Save Changes in' dropdown (this is important)
    - Select Macros in the list of Categories on the left.
    - Select ShowForm in the list of macros on the right.
    - Click in the 'Press new shortcut key' box.
    - Press the shortcut key combination you want to assign, for example Alt+Ctrl+G.
    - Click Assign.

  10. #10
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    Amazing! That did the trick. Thank you for your help. If I don't get stuck again, Have a nice weekend <img src=/S/cloud9.gif border=0 alt=cloud9 width=25 height=23>

    Thank you,
    SME

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repeat Completed Rows (Word 2003)

    You're welcome!

  12. #12
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    Happy Monday! I'm stuck again. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    I set up the custom menu item that brings up my UserForm, but if I enter information into the UserForm it does not automatically update the fields, I have to manually update each field. While the custom menu item is very handy for my use, Is there a way I can get the UserForm to appear at the start of the form (as show in the example) as that may be a better option for mass distribution.

    This is the Code for my Userform:

    Option Explicit

    Private Sub cmdCancel_Click()
    Unload Me
    End Sub

    Private Sub cmdOK_Click()
    ' Prevent variable from being deleted
    If txtDate = "" Then txtDate = " "
    ActiveDocument.Variables("Date") = txtDate
    If txtCookName = "" Then txtCookName = " "
    ActiveDocument.Variables("Cook Name") = txtCookName
    If txtRecipeNumber = "" Then txtRecipeNumber = " "
    ActiveDocument.Variables("Recipe Number") = txtRecipeNumber
    ' Update fields in document
    ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Range.Fields.Update
    Unload Me
    End Sub

    Private Sub txtRecipeNumber_Click()

    End Sub

    Private Sub txtCookName_Click()

    End Sub

    Private Sub txtDate_Click()

    End Sub

    Private Sub basShowform_Initialize()
    ' Load variables into text boxes
    On Error Resume Next
    txtDate = ActiveDocument.Variables("Date")
    txtClientName = ActiveDocument.Variables("Cook Name")
    txtClientIDNumber = ActiveDocument.Variables("Recipe Number")
    End Sub

    Private Sub UserForm_Click()

    End Sub



    SME

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Repeat Completed Rows (Word 2003)

    Look at the ThisDocument module in my example to see how the userform is displayed when you create a new document based on the template:

    Private Sub Document_New()
    ShowForm
    End Sub

    (ShowForm is a macro in the basMacros module)

    If you also want the userform to be displayed each time the user opens a document based on the template, add the following code to the ThisDocument module:

    Private Sub Document_Open()
    ShowForm
    End Sub

    In the example, the fields are in the page header. They are updated by the line

    ActiveDocument.Sections(1).Headers(wdHeaderFooterP rimary).Range.Fields.Update

    If you placed the fields in the body of the document, you can use

    ActiveDocument.Fields.Update

    instead.

  14. #14
    Lounger
    Join Date
    Jul 2006
    Location
    N. Highlands, California, USA
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Repeat Completed Rows (Word 2003)

    Good Afternoon,

    I'm stuck again on the issue of having the UserForm pop up when the document is first opened. I was able to add all the fields and I can manually show the form. I compared my form to the tester form in this thread and I just can't figure it out. Any help would be really, really great! <img src=/S/time.gif border=0 alt=time width=32 height=48> I'm on a time crunch (end of the day today). I even bought a "Mastering VBA" book to no avail.

    Thank you,
    SME
    Attached Files Attached Files

  15. #15
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Repeat Completed Rows (Word 2003)

    Did you try the Document_Open() suggestion above? It should run immediately after a document is opened. This assumes that macro security is Medium or lower. If it's High, then probably nothing will happen.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •