Code to drop down list on userform 
Author Message
 Code to drop down list on userform

Word97: Problem 1
I want to ensure a drop-down field in an (Microsoft Speak) on-line form is
changed if the default value (which is the first in the list) is incorrect
for the user.  So I thought an autoNew macro in the template that expands
the drop down a list in a new document would be the way to go.  So far, all
I have been able to do is select the formfield using:
    ActiveDocument.Bookmarks("bmDept").Select  which doesn't support the
doClick method or
    Dim field1
    Set field1 = ActiveDocument.Fields(1)
    field1.DoClick
which doesn't click the drop-down button to expand the list.  The field is
assigned a bookmark named "bmDept" and is the first field.

Problem #2 On the same form, the third column in a table contains a checkbox
for each row.  In order to make the checkboxes accessible to the user, the
table would have to be protected in the template, but then the rest of the
table and the checkboxes cannot be accessed in the document.  Any
suggestions?
Thanks.



Sun, 20 Jun 2004 04:28:27 GMT  
 Code to drop down list on userform
The subject should have said online form, not userform.  Sorry for any
confusion

Quote:
> Word97: Problem 1
> I want to ensure a drop-down field in an (Microsoft Speak) on-line form is
> changed if the default value (which is the first in the list) is incorrect
> for the user.  So I thought an autoNew macro in the template that expands
> the drop down a list in a new document would be the way to go.  So far,
all
> I have been able to do is select the formfield using:
>     ActiveDocument.Bookmarks("bmDept").Select  which doesn't support the
> doClick method or
>     Dim field1
>     Set field1 = ActiveDocument.Fields(1)
>     field1.DoClick
> which doesn't click the drop-down button to expand the list.  The field is
> assigned a bookmark named "bmDept" and is the first field.

> Problem #2 On the same form, the third column in a table contains a
checkbox
> for each row.  In order to make the checkboxes accessible to the user, the
> table would have to be protected in the template, but then the rest of the
> table and the checkboxes cannot be accessed in the document.  Any
> suggestions?
> Thanks.



Sun, 20 Jun 2004 04:34:18 GMT  
 Code to drop down list on userform
1) You could muck around with SendKeys, or maybe all you need is to
just set a different default value using something like:

Dim d As DropDown
Set d = ActiveDocument.FormFields(1)
d.Value = 2

2) Use a continuous section break around the bit that needs form
protection. You will need to break your table to do this I think.

On Tue, 1 Jan 2002 15:28:27 -0500, "Dave"

Quote:

>Word97: Problem 1
>I want to ensure a drop-down field in an (Microsoft Speak) on-line form is
>changed if the default value (which is the first in the list) is incorrect
>for the user.  So I thought an autoNew macro in the template that expands
>the drop down a list in a new document would be the way to go.  So far, all
>I have been able to do is select the formfield using:
>    ActiveDocument.Bookmarks("bmDept").Select  which doesn't support the
>doClick method or
>    Dim field1
>    Set field1 = ActiveDocument.Fields(1)
>    field1.DoClick
>which doesn't click the drop-down button to expand the list.  The field is
>assigned a bookmark named "bmDept" and is the first field.

>Problem #2 On the same form, the third column in a table contains a checkbox
>for each row.  In order to make the checkboxes accessible to the user, the
>table would have to be protected in the template, but then the rest of the
>table and the checkboxes cannot be accessed in the document.  Any
>suggestions?
>Thanks.

Steve Hudson, Word Heretic
HDK List MVP



Wed, 07 Jul 2004 07:15:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Drop Down List Box - Drop Down portion does not always disappear after Click event

2. VBA code to go to a bookmarked drop down goes to wrong drop down

3. VBA Code for Defining Drop Down List

4. Drop-down list in a list view

5. List of servers in VB for a drop down list

6. Press F1 key while drop-down menu item highlighted, drop-down menu stays on top

7. Data bound drops downs dont drop down!

8. Max 65536 rows in drop-down list (Access)

9. Getting a drop down resource list when filtering by resource and date range

10. Disable IE5.5 drop down list when I type text within a web page - PLEASE HELP

11. Drop Down List in a field

 

 
Powered by phpBB® Forum Software