Trying to run UserForm_Initialize 
Author Message
 Trying to run UserForm_Initialize

I'm sure there is simple solution to my problem, but I
can't seem to find it. Help would be appreciated. I have
used the code in "Load a ListBox from a Named Range in
Excel using DAO". Everything works when I force it to run,
but I don't know how to run the code automatically when
either the document opens or the respective combo box is
clicked or has focus. I want the combo boxes to be
populated when a user clicks in it so they can make the
appropriate selection.

TIA!

--Maha



Sun, 01 Jan 2006 05:35:28 GMT  
 Trying to run UserForm_Initialize
Hi Maha,

It would be better to populate the list box when the userform is
initialized, unless the content is dictated by some other action taken on
the userform in which case the code to populate the listbox would be
included in code associated with that event.

To populate in when the form is initialized, in the Visual Basic editor,
right click on the userform in the Explorer Window and select View Code and
create the Initialize() event in the code pane that appears.

To get the basics, see the article "How to create a Userform" at:

http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> I'm sure there is simple solution to my problem, but I
> can't seem to find it. Help would be appreciated. I have
> used the code in "Load a ListBox from a Named Range in
> Excel using DAO". Everything works when I force it to run,
> but I don't know how to run the code automatically when
> either the document opens or the respective combo box is
> clicked or has focus. I want the combo boxes to be
> populated when a user clicks in it so they can make the
> appropriate selection.

> TIA!

> --Maha



Sun, 01 Jan 2006 07:21:19 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. UserForm_Initialize() not running

2. UserForm_Initialize query

3. I have tried and tried.... and tried

4. Run time error when trying to save a created file

5. Problem trying to run any code in Access XP

6. Trying to run mdb using A2K Runtime generates runtime error

7. Help! Trying to run a Select Case

8. Error trying to run VB dll from Excel VBA

9. Getting prompted while trying to run a batch file

10. macro trying to run for virus check

11. Word freezes trying to run macro or open vba using Alt-F11

12. Word crashes when trying to run macros

 

 
Powered by phpBB® Forum Software