How can I combine strings in new line on a memo field

A

AMN

Hi
I have a table named History and table named Medications. The key in
History is EncounterID and there is a memo field in History named MedList.
The key in Medications is MedicationID and there is a one to many
relationship between History and Medications tables as one EncounterID can
have multiple MedicationIDs. I have a HistoryForm in which there is a
MedicationSubform.

I would like to write a code so that when the user fills in all the records
in the MedicationSubform and moves onto a different subform, the MedicationID
control data is added to the Medlist memo field in a list format. Preferable
numbered but if that is not possible just as long as they are in a list one
under the other.

I am trying to do this because I would like to merge the History table
fields onto a Word letter document and have a section named medications that
I want all the MedicationIDs listed. I couldn't figure out how to make the
Word document look up multiple records for a single document so I thought I
get around it this way.

I would truly appreciate help is solving this problem in any way.

Thank you,
 
K

Klatuu

I think you would be happier with the results if you did not try to pull
everything into a memo field. Keeping the memo field in sync with a table
would be problematic and unnecessarily bloat your database.

As to getting the data into Word, you can use MSQuery to pull the data you
need into Word. You may have a little bit of a learning curve, but it isn't
that big of a deal. If you can do a QBE in Access, you can use MSQuery.
 
K

Klatuu

I am not your best expert working with Word. What I have done is to create
the query from within Word and attach to the database to use in mail merge.
All the updates are done in Access.

You might get some better help if you discuss your problem in a Word group.
 
A

AMN

Trouble is that I already have mail merge linked to another table in the
database that has all the other relevant information for the record.
However, this record has a one-to-many relationship with the medications and
I want to have all the related medications listed. It is just like having a
customer with an order and multiple items in the order. The word document's
mail merge is linked to the customer, what I need to do is give a list of all
the order details.

I will try to ask this from the Word forum but if you could help me out with
the initial question of placing multiple record fields into one memo field I
can get around this. As I will be doing this individually into a temporary
table, it will not inflate my database as the information is purged after
printing of the Word document.

Much thanks for all your time.
 
K

Klatuu

I would like to be able to help more, but as I said, Word is not my strong
suit. The only thing I can think would be to change your mail merge to link
to a query that would include the data from both tables.
 

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