Web Development



Access Subform Data export to Word

By gregory18 ·
Tags: Microsoft

I really some help! Here's a link to a google drive zip of the db.

So, what I have is an access database made up of a few tables and a form and some sub forms. The database info gets inputted to the tables via a form that I've created. In the example, the form is called "Database". This form exports to a word document, fields on the database go to bookmarks on the word doc. This works great so far.

In the attachment there is a "template" folder with the original word document, when the code runs it saves the completed form to the "generated" folder - works like a charm. Its a very long form for applications for liquor licenses.

So you fill in the form in access, it saves to the tables and exports the data to the word template document.

The problem that I have is that there is a subform on tab8 of the form where "director details" are saved. There can be any number of directors per application. I've managed to access the data on the subform's table, but have no idea how to loop through the data in that table to get all the information that is applicable to that application only and not data related to other applications. There is a relationship between the director details table and the application details table(this is the main table) and I'm using an application identifier field that I've created called and "ACNumber" which is unique to each application. There is a combobox on the form that selects the application and the form and subforms bring up the correct data when you select it.

The other part of the problem is how do I output this to word? A bookmark won't work, because all the fields are being repeated. Is there a way that all the data entries can be outputted to a single bookmark mabe in a textbox with the labels?

This is how it looks on the word document form:

(First person)
Full name : [ generate from item 5.4(a) from database]
Physical address : [ generate from item 5.4(b) from database]
Postal code : [ generate from item 5.4(c) from database]
Postal address : [ generate from item 5.4(d) from database]
Postal code : [ generate from item 5.4(e) from database]
Identity number : [ generate from item 5.4(f) from database]

(More person’s to add if needed)

Ok, I hope that describes my problem accurately.
I've tried all sorts to get this working, but its beyond me, please help guys!!!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums