Results 1 to 15 of 15
  1. #1
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Forms with Address (2000/SR1)

    I am trying to set up a form template, which is basically a letter, using form fields. What I would like to be able to do is to have a drop down box where the user selects the name of the customer, and the form fills in the address automatically. I know that there has to be a way to do it but I'm drawing a blank. Thanks for any help.

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Forms with Address (2000/SR1)

    Are you using the controls on the forms toolbar, or the controls on the controls toolbox toolbar?
    Regards,
    Rudi

  3. #3
    4 Star Lounger
    Join Date
    Aug 2001
    Location
    Anaheim, California, USA
    Posts
    560
    Thanks
    17
    Thanked 2 Times in 2 Posts

    Re: Forms with Address (2000/SR1)

    I am using the Forms Toolbar controls, although if there is a better way, I am willing to learn. Thanks.

  4. #4
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Forms with Address (2000/SR1)

    I type under correction, but I don't think you will be able to use the Forms toolbar controls to achieve this! Although you can have a stored macro trigger on entry and exit off these controls, your request is more complicated. You will need to use the cntrols toolbox to achieve this, as the controls are linked the event procedures that can be programmed to do more intricate tasks! I have not attempted this before, but theoretically, you couls store the addresses as autotext, and then proram a combo box control to run the appropriate autotext based on the value selected in the combo box.
    I will have a look at the dynamics of this and come back to yoo soon!

    If anyone else has a easier routine, please speak up!!!
    Regards,
    Rudi

  5. #5
    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: Forms with Address (2000/SR1)

    Is there a large number of customers? If so, this could be a bit clunky, but let's go with it for a minute. Assuming your drop-down contains the entire list, you can create an Exit macro that reads the value in the drop-down and sets the value in your address field(s). Where would you store that information? One possible place is the database you might already have of your clients' addresses (whether in Access, a text file, or Outlook). Another possibility is to stash the information in the template somehow. I'd say AutoText is logical, but I don't know whether you can insert AutoText into a protected form.

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    Don:
    This can be done, but is a bit clunky if you have numerous names. The trick is to have "Calculate on exit" checked in the form fields & use IF fields for the addresses. The IF field is in the format of:

    {IF {REF name} = A "Address of A" "{IF {REF name} = B "Address of B" "etc." }"}, where <big><font color=red><code>name</code></font color=red></big> is the bookmark name of the Name formfield & the curly brackets are inserted by pressing Ctrl+F9, not typed.

  7. #7
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Forms with Address (2000/SR1)

    Hi again,
    I am just following up on my previous post to show you a working example of my "Theory". Please be informed that I slapped the code together without much thought to error handling and coding etiquette! If you follow the instructions on the page, you will be able to customize this further. I see you have other posts. If those are better answers, please ignore this post! Many choices give you more options and hopefully better solutions, so here goes!....
    Attached Files Attached Files
    Regards,
    Rudi

  8. #8
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    <hr>I'd say AutoText is logical, but I don't know whether you can insert AutoText into a protected form. <hr>
    I agree with you that AutoText is a good solution:
    - switch protection off
    - place cursor at the correct position
    - insert AutoText item
    - switch protection on

    I would suggest to name the AutoText entries to correspond with the list index number of the dropdown or (in this case) the persons last name.

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    You can insert AutoText into a protected document. If you have an on entry or exit macro that inserts the Autotext entry, it will run while the document is protected. However, I'm not clever enough to develop a macro that allows you to choose from a category in a drop down list.

  10. #10
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    I have wanted to do this very same thing before, and have used the
    {IF {REF name} = A "Address of A" "{IF {REF name} = B "Address of B" "etc." }"},
    method which Phil Rabichow outlined. This worked fine but is indeed very 'clunky' <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    If I did this again I might use the Autotext, does the Autotext data just stay in the document, or does it go into the normal template? I imagine the specific autotext would only want to be kept with the document in question.
    Thanks,

    pmatz

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    You cannot save an Autotext entry in a document. It must be saved in a template. To be available to the protected document, it must either be in a global template or in the attached template.

  12. #12
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    Sorted! Got it working, and much simpler than the { IF ... } scenario!

    I have saved all the relevant addresses as autotext in a unique template, and created a document from there. it works a treat. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    thanks chapps
    Thanks,

    pmatz

  13. #13
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    Glad it's working. Did you use a text form field or a drop down list for the autotext? Also, I wouldn't mind seeing the code you used to insert the autotext, especially if it is different from <!mskb=212190>Microsoft Knowledge Base Article 212190<!/mskb>.
    Cheers,

  14. #14
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    Hi Phil, I used a dropdown box which I listed the names of the autotext entries ( Matz, Ben, Joe) and then used a { REF } field in the { AUTOTEXT } field. Press ALT F9 to look (u knew that !! <img src=/S/grin.gif border=0 alt=grin width=15 height=15> )
    Attached Files Attached Files
    Thanks,

    pmatz

  15. #15
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forms with Address (2000/SR1)

    Thanks, I like it. Just goes to show how you (actually I) can get tunnel vision. <img src=/S/smile.gif border=0 alt=smile width=15 height=15> I was thinking of a much more complicated method.

Posting Permissions

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