Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Option Buttons (97)

    Hello Word Forum

    I have a database which has had a lot of help from Woody's Lounge. I've been asked to reproduce one of the database forms as a Word document. Of course I said "no problem" to impress the boss thinking that VBA in Word can't be that much different to VBA in Access!

    The form has groups of three option buttons which I've grouped with:

    Private Sub UserForm_Initialize()
    OptionButton1.GroupName = "ClientType"
    OptionButton2.GroupName = "ClientType"
    OptionButton3.GroupName = "ClientType"
    End Sub

    Copied from the help page.

    Can anybody let me know how to group the three buttons so that when one's value is true, the other two are false. There must be an easier way than loads of if then statements!

    Why can't I select more than one object with the shift key down in order to change a common property like I can in Access?

    Why is there no border property to the option button? And the colours and lines tab is shaded out on the format control dialogue box.

    All help gratefully received.

    Regards

    Graeme
    Attached Files Attached Files

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

    Re: Option Buttons (97)

    Forms in Word are quite different from those in Access. In fact, there are different types of form, and you are confusing them.

    1. You can make a Word document look and act like a form. This can be done with controls from the Forms toolbar (only a text field, check box and dropdown list are available) and also with controls from the Control Toolbox toolbar. You have used the latter to create the option buttons, as far as I can see.

    2. You can design UserForms in the Visual Basic Editor. You create a blank form by selecting Insert | UserForm. The code for UserForm_Initialize you posted is meant for such a form, it has no meaning for a document with embedded controls.

    - The three option buttons on your document will act as a group: as soon as you click one, the other two will be turned off.
    - An option button doesn't have a BorderStyle property, and its label is an integral part of the control, not a separate control as in Access.
    - You can set a background color for an option button. You must be in design mode for this (the first button on the Control Toolbox must be "down".)
    - Your option buttons float above the text. The Colors and Lines tab is only available if they are inline objects. You can set the background color for both inline and floating objects using the Properties window (click the second button on the Control Toolbox.)
    - To select more than one option button, make sure that you are in design mode, and click the Select Objects button on the Drawing toolbar (it looks like a northwest arrow.) You can now drag a rectangle around the option buttons. Make sure to turn off Select Objects mode and Design mode later.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (97)

    Hans

    Thanks for that. As always that covers just about everything, I'll go away and experiment.

    Regards

    Graeme

  4. #4
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (97)

    Hans

    I've had a look! I had a go at the User Form and whilst it was not time wasted as I now know a bit about user forms, it won't serve the purpose as the section with the option buttons is a financial risk assessment which needs to form part of a larger tender information audit form and not sit in a separate window.

    I did it again using the forms tool bar and check boxes but I've just produced a form that looks like the form in my database but it doesn't do a lot (attached). The check boxes need to work in groups of three exclusively, like option buttons and the Totals Form Fields need to add up the boxes that are checked above them. The last row then automatically checks the correct check box.

    I'm aware that it is not the function of the forum to do people's work for them so if there is a lot of work involved in achieving the results I need then the users can print off the 'lookalike' form from Word and fill it in by hand or they can get their act together and use my database!

    However, if the attached just needs some code behind it to make it work then all pointers gratefully received.

    Regards

    Graeme
    Attached Files Attached Files

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

    Re: Option Buttons (97)

    Perhaps somebody else knows how to do this quickly; it would cost me too much time, sorry.

  6. #6
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (97)

    Hans

    Thats ok. If you don't have a definitive answer then I would guess that neither does anybody else!

    The non Access users can use the printed form and sort out the check boxes manually or they can start using my database.

    Regards

    Graeme

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Option Buttons (97)

    Following down the current path is a lot of work (including maintenance) for very little return. Whilst it can be done, the rewards are not likely to make it worthwhile.

    Have you thought about sharing your Access form on the intranet. The users would be able to get a print out to fill in by hand or complete it online. This saves on maintenance as well.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (97)

    Andrew

    Thanks for you input.

    I have a copy of the Access form as a Word document for people to print and fill in, I was just playing with forms in Word in an attempt to make it behave like the Access version.

    Perhaps the way forward is to leave the Word form as it is and encourage our IT people to install Access on all the company pcs and get people to use the database!

    Regards

    Graeme

  9. #9
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Option Buttons (97)

    It is possible to make the Access Database a Run time version which means that the other users don't need to have Access installed to run it.

    I believe you need the developer version of Office to do this but it is likely to be a cheaper option than installing Access on everyone's machine.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  10. #10
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Buttons (97)

    Cheers Andrew

    I'll pass that to IT

    Regards

    Graeme

Posting Permissions

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