Send Form Fields to Word Template (1 Viewer)

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
Hello!

I have been searching the internet and racking my brain, but I am fairly new to VB coding so I might just be being really stupid and I am truly sorry if this has been asked and answered before, but I did a search and couldn't find much that related to my problem...

I have a form with fields that contain the address/postcode etc of the person in question, and I also have a template letter that needs to have said persons address/postcode etc at the sending stage after a button is clicked.

I have tried doing a mail merge, but I am really inexperienced with anything office related other than using it to write essays for high-school, and access/vb coding is a totally different kettle of fish!

If anyone can offer any help I would be greatly appreciative, an example field name is "shkAdd1" and "shkPostCode"

Thanks in Advance
 

vbaInet

AWF VIP
Local time
Today, 02:53
Joined
Jan 22, 2010
Messages
26,374
So were you able to do a mail merge first?

Welcome to AWF!
 

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
I am able to do a mail merge, however the filter that I have applied to the subform does not carry over onto the mail merge, so all addresses are sent to mail merge, filtered AND unfiltered!
 

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
Sorry about the delay, was out of the office most of yesterday!

I have attached the database and label template (I used bookmarks for the mail merge, but I get the feeling that this is not the most efficient way of doing it.

The form/subform in question is the filterform, due to the nature of my database you may need to click on the "admin tools" button on the main form (nomform) to return to access main screen, the password is Riddlesdown1

If there is anything else I can send you or help you with please let me know, I have a feeling that it is an easy fix, but as I said I am not that skilled with vba and access and have been using internet guidance to complete everything else I have completed so far :S

Thanks in advance :)

EDIT: Removed attachement for security reasons!
 
Last edited:

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
Ah, if you are on the main form and wish to access the filter form click on the "Filter All" button!

It doesn't need to be exported to the mail merge template I have sent you per se, if we could get the filtered sub form to an excel sheet it would be just as useful as an automatic mail merge, whichever is least amount of hassle for me to code! :D
 

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
SOLVED!

I have been able to solve this problem, and for future browsing purposes I will send the link, even though it is not to this website I think it will be valuable to somebody someday!


Using this process I was able to create a "dynamic" query, the SQL that decides this is changed dependant on the filter value set on the subform property as far as I am aware, this allows it to change dependent on what the filter value is changed to.

Instead of attempting to export the subform in all its glory, it instead exports the filtered query, although all fields are shown, it is a vast improvement from having all records shown!

Thanks for the help anyway :)
 

vbaInet

AWF VIP
Local time
Today, 02:53
Joined
Jan 22, 2010
Messages
26,374
Good to hear that you resolved the problem.
EDIT: Removed attachement for security reasons!
In the future, don't upload a db that contains confidential information. Just upload something with erroneous data.
 

MooTube

Registered User.
Local time
Yesterday, 18:53
Joined
Jul 2, 2015
Messages
31
I will try not to, beginners mistake I guess :)

I'm not able to post the link yet but as soon as I have 10 posts I shall come back here and post it :)
 

Users who are viewing this thread

Top Bottom