Results 1 to 4 of 4

Thread: Forms (XP)

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

    Forms (XP)

    Hi, I am trying to get a document to be automted and am stuck in the following area. <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>
    I have a combo box from the forms toolbar with names in it, its bookmark name is P1.
    I want to get an IF Field to give me different values depending upon which name is selected in the combobox.
    If I use an ask field then i can do
    IF P2 = "paul" "admin" ""
    and when i calculate this works fine, but for some reason when i use this IF with the bookmark for the combobox field it doesnt work.

    does this make sense? and can anyone help?

    <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>
    Thanks,

    pmatz

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

    Re: Forms (XP)

    With protection turned off, double click the combo box. Tick the "Calculate on exit" box, then click OK.

    The IF field must contain P1 as a nested field:

    { IF { P1 } = "paul" "admin" "" }

    As usual, you must *not* type the field braces { }, but use Ctrl+F9 to insert them.

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

    Re: Forms (XP)

    Thanks Hans, it was the nesting of field within the field brackets that i didnt do.

    CTRL F9. cool

    what i have done is assigned different data in a table to bookmarks to be used in the IF fields, now i am wondering if i can code in VB to set the bookmarks.

    i am kinda lost amidst the ActiveDocument.Bookmarks.Add

    can u name a bookmark and assign its value with a string in VB? i am more familiar with basic VB6 and excel vb so WORD is my new challenge !
    Thanks,

    pmatz

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

    Re: Forms (XP)

    The easiest way to set a bookmark to a string (which need not occur in the document) is to create a SET field:

    { SET MyBookmark "Text string" }

    Setting a bookmark in code always involves setting the bookmark to a range. The text of the range is the value of the bookmark. So you'd have to loop through the cells of the table and create a bookmark for each cell.

Posting Permissions

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