Using Access as Data Source

S

Steve C

I am creating a Word template with a userform. The form features a combo box
populated with 175 manufacturers (using .AddItem). When a manufacturer is
selected, I would like text boxes elsewhere in the userform (for Contact
Name, Address, Phone) to update with the chosen manufacturer's information.
This gives the user a chance to verify this information before clicking OK
and feeding it into various areas of the document.

Rather than writing 175 Select Case statements to populate the text boxes,
I'm thinking that since I already have the contact info in an Access db
called CompanyInfo in a table called Contacts, I could somehow use this table
to feed the text boxes. My problem is I don't know the code needed to call
the table and have it populate the text boxes. How do I do this? Thanks!
 
J

Jonathan West

Steve C said:
I am creating a Word template with a userform. The form features a combo
box
populated with 175 manufacturers (using .AddItem). When a manufacturer is
selected, I would like text boxes elsewhere in the userform (for Contact
Name, Address, Phone) to update with the chosen manufacturer's
information.
This gives the user a chance to verify this information before clicking OK
and feeding it into various areas of the document.

Rather than writing 175 Select Case statements to populate the text boxes,
I'm thinking that since I already have the contact info in an Access db
called CompanyInfo in a table called Contacts, I could somehow use this
table
to feed the text boxes. My problem is I don't know the code needed to
call
the table and have it populate the text boxes. How do I do this? Thanks!

Although it deals with document forms rather than UserForms, the following
article ought to point you in the right direction regarding interfacing with
Access

Please Fill Out This Form, Part 5
How to link your Word autoform to a database.
http://www.computorcompanion.com/LPMArticle.asp?ID=136


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top