By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

Column names for customized query and merge

P: n/a
I want to provide users with an interface to create a custom merge
(all in Access, not Word). User will put in a set of brackets ("<>")
in a memo field and when they click the merge button it will grab the
fields listed in a tabular subform and merge it with their memo text.

I was able to retrieve the code to list the column names of a table.
I constructed the code to iterate the tabular subform rows and replace
the brackets with the row text in order.

What I need now is to able to allow the user to specify the column
they wish to lookup. Once the column is retrieved, in the next column
will be listed the corresponding value from the correct record.

----------
Example:

My name is <from <>.
-----------

In a combo box I would select the table or query. Beneath that combo
box would be a tabular subform with a combo box and text box. Combo
box would be populated with the selected table or query's column
names. When the column name is selected, the corresponding field in
the table/query would appear in the adjacent text box.

I then have code to iterate over the set, merging them in order into
the memo text.

So in the example above the table would be selected:

tblPerson

and the column names would be selected in the tabular subform combo
box:

Name
State

and alongside the column names the text box would auto populate:

Name Jim
State Texas

Why go through this trouble? The Word merge code that I've found is
WAY too slow.

--

Christian

May 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 23 May 2007 07:23:33 -0700, ch************@yahoo.com wrote:

You may regret later not to use Word mailmerge. It has powerful
features you can't rewrite so easily.

I'm not sure I follow. You say "What I need now is to able to allow
the user to specify the column they wish to lookup."
You also say: "I was able to retrieve the code to list the column
names of a table."
I'm thinking: problem solved.
Actually, you could have saved yourself the second step: just set the
RowSource of a dropdown to a tablename, and set the RowSourceType to
"Field List".

What else did you need help with?

-Tom.

>I want to provide users with an interface to create a custom merge
(all in Access, not Word). User will put in a set of brackets ("<>")
in a memo field and when they click the merge button it will grab the
fields listed in a tabular subform and merge it with their memo text.

I was able to retrieve the code to list the column names of a table.
I constructed the code to iterate the tabular subform rows and replace
the brackets with the row text in order.

What I need now is to able to allow the user to specify the column
they wish to lookup. Once the column is retrieved, in the next column
will be listed the corresponding value from the correct record.

----------
Example:

My name is <from <>.
-----------

In a combo box I would select the table or query. Beneath that combo
box would be a tabular subform with a combo box and text box. Combo
box would be populated with the selected table or query's column
names. When the column name is selected, the corresponding field in
the table/query would appear in the adjacent text box.

I then have code to iterate over the set, merging them in order into
the memo text.

So in the example above the table would be selected:

tblPerson

and the column names would be selected in the tabular subform combo
box:

Name
State

and alongside the column names the text box would auto populate:

Name Jim
State Texas

Why go through this trouble? The Word merge code that I've found is
WAY too slow.
May 24 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.