WORD + ACCESS vb

I

iris

Hello everybody.

I have a table in access with 12 columns.

I have created a form in WORD with 1 combobox and 12 textboxes.

I need to populate the textboxes with values when I choose a value in the
combobox...

can anyone tell me how to do that?
 
R

ryguy7272

I can give you several solutions if you want to control the action from
Access. Unless you want to use Mail Merge, and perhaps record a macro while
running through the setup, I am not sure how to control it from Word.

Regards,
Ryan---
 
I

iris

Hi and thanks for your reply.

I know how to mail merge from access to word.
Here I need to make a userform in word and populate textboxes in the user
form... I just can't seem to fined the solution...
 
G

Gordon Bentley-Mix

Take a look at Greg Maxey's Populate UserForm ListBox article
(http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm) - especially the
part on using external data sources. I'm not sure how to make it work with
an Access data source, but I'm sure it can be done.
--
Cheers!

Gordon Bentley-Mix
Word MVP

Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.
 
I

iris

It can be done... I used a code simillar to his - insted of listbox I
populated a combobox - but there is a problem there I can't solve...

It works OK with

ComboBox1.Column(0, i) = rsi.Fields("hebMakor")
to
ComboBox1.Column(9, i) = rsi.Fields("chiled")

but when it gets to

ComboBox1.Column(10, i) = rsi.Fields("mm")

it encounters error 380

"could not get the column property. Invalid property array index"

and for the lyfe of me!!!! I can't understand this!

Is there a limit on the columns number?

I tried to send greg the question and got an answer that

Delivery to the following recipients failed.

(e-mail address removed)

can you tell me how to contact him?

Pleeeeaas!!!! I'm desperate!
 
I

iris

Sorry

it's error 381

iris said:
It can be done... I used a code simillar to his - insted of listbox I
populated a combobox - but there is a problem there I can't solve...

It works OK with

ComboBox1.Column(0, i) = rsi.Fields("hebMakor")
to
ComboBox1.Column(9, i) = rsi.Fields("chiled")

but when it gets to

ComboBox1.Column(10, i) = rsi.Fields("mm")

it encounters error 380

"could not get the column property. Invalid property array index"

and for the lyfe of me!!!! I can't understand this!

Is there a limit on the columns number?

I tried to send greg the question and got an answer that

Delivery to the following recipients failed.

(e-mail address removed)

can you tell me how to contact him?

Pleeeeaas!!!! I'm desperate!
 
I

iris

Hi Gordon,

I have created a userform with a textbox1.

I want to populate this listbox with 13 columns, and give each column a title.

for example:
the listbox feeds from a database: world.db
the table is called: countryCity
and the City column in the database is called "Cities"

I columncount(0, i) = New york

I want the title of the countryCity column to be : "Tail of a City".

so the listbox should look like this:

Tail of a city country (This should be the
title)
New York New York (This is the data from
the database)

I have posted this problem to Greg to in the hope that somronr will be able
to help me with that.

I hope I made my problem clear.... and I really REALLY hope you can help me...

Regards,

Iris
 
D

Doug Robbins - Word MVP

Listbox Column Headings (Titles) cannot be populated using VBA.

If the source of the data is an Excel Spreadsheet, and the RowSource
property of the List Box starts one row below the row that contains the
titles, then the information from the row containing the tiles will appear
as the column headings.

See: http:/support.microsoft.com/kb/q165494/

AFAIK that is the only way to populate column headings.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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