Modules & VBA :: Mail Merge - Database Placed In A State By User That Prevents It From Being Opened Or Locked

Jun 19, 2014

I have the following code which errors on line

Code : .OpenDataSource Name:=CurrentProject.FullName, SQLStatement:="SELECT * FROM [qryMailMerge]"

The error (Error has occurred: The database has been placed in a state by user 'Admin' on machine 'W74XXXXXX' that prevents it from being opened or locked) appears in the Word document.

Code:
Public Sub CreateWordToPDF(strWordFile As String, strPDFFile As String, strSQL As String)
'Call CreateWordToPDF("C:Doc1.doc", "C:Doc1.pdf", "SELECT * FROM [qryMailMerge]")

Dim objWord As Word.Application
Dim docWord As Word.Document
'Open MS Word using early binding.
Set objWord = New Word.Application
Set docWord = objWord.Documents.Open(strWordFile)

[Code]......

View Replies


ADVERTISEMENT

Automated Mail Merge: Problem With One User On The Network

Jun 19, 2006

Hi,
I have searched the forums but cant seem to find a similar problem anywhere.

I am using a shared Access Database over a network with 8 users. I can successfully run an automated mail merge to Word with the following code;

********
Dim stDocName As String
stDocName = "qryCreateCandidateCVBasicDetails"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit

Dim objWord As Word.Document
Set objWord = GetObject("X:CRS DocumentsDatabase TemplatesCRS CANDIDATE CV.dot", "Word.Document")
objWord.Application.Visible = True

objWord.MailMerge.OpenDataSource _
Name:="X:CRS DocumentsCRS DatabaseCRS Database V3.mdb", _
LinkToSource:=True, _
Connection:="tblCandidateCV1", _
SQLStatement:="SELECT * FROM [tblCandidateCV1]"


objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Documents(2).Close wdDoNotSaveChanges

Set objWord = Nothing
**********

For some reason on one of the PC's will not run this code; instead of executing the merge they get a message asking them to connect to a data source. It is possible to then browse and connect to the data source manually - but I cant understand why it isnt executing properly and merging the data automatically.

4 PC's on the network are running Windows XP Pro, the others are on Windows 2003. The PC with the problem is running on 2003 (although others with the same software seem to work fine).

Can anyone shed any light on this or suggest anything I could try to resolve this problem.

Any feedback would be most welcome. Thanks in advance.

View 1 Replies View Related

Mail Merge Database

Sep 24, 2004

Can some on explain to me what I need to install and how to send a personalized mail merge from Access. I would like to use the names and email addresses from my database to send individual emails to everyone in it. Where do I find the proper add on? Thanks alot. Alex

View 3 Replies View Related

Mail Merge From Database To Multi Members

Jan 3, 2006

Hello,
i am creating a database for a membership of my martial arts academy, so far i can add and search members.

i would like to have a mail merge feature on this, so that i have a list of all the people with a check box next to their name, if the box is ticked their name is added to the mail merge. if its not ticked its not added.

All help is much appreciated.

Aaron.

View 4 Replies View Related

Mail Merge Opening Another Copy Of Database

Dec 11, 2006

Hey Guys,

Hope you can help as this one's got me stumped!

I'm using Access 2000 and run a mailmerge function via a button on a form. (It opens Word, which then uses a query in the database to refer to and then 'automerges' into a new Word document).

It used to work absolutely fine but now it opens Word and then opens another copy of the database (so I have 2 running) and all hell breaks loose.

Any ideas what I can do to stop this? Has anyone come across this before?

Any help/suggestions would be gratefully recieved as I feel like I'm in a 'needle in a haystack of needles' situation here.

Cheers,

Rusty
:D

View 2 Replies View Related

Mail Merge Using Access Database Fields?

Feb 28, 2006

I think the title describes best what I want to do. I need to send a letter to some lets say receivers, who fulfill certain criteria, and who appear in a data field in an access database. The letter is common for everyone with the difference of course of their address and name. I am sure this is an easy one for the most of you....

Thanx in advance, Kyriakos
p.s. sorry for misspelling some words...

View 1 Replies View Related

Modules & VBA :: One To Many Mail Merge

Sep 8, 2014

Any simple working mail merge application with a one to many field filling into the word document. I have no problem with a one to one, but if the subform has 2 or more associated records related to the main form, I cannot pass all the fields. Build a recordset loop or concatenated script so I can learn from it and add it to an existing project.

Example:
main form: CustomerID, Customer, Address
subform: ProductID, Product, Cost, fk_CustomerID

Sample data:
main form: 1, James Smith, 118 Clover Lane
subform entry 1: 4, Small Shipping Boxes, 2.00, 1
subform entry 2: 5, packing tape, 1.75, 1
subform entry 3: 3, Large Shipping Boxes, 3.00, 1

View 2 Replies View Related

Microsoft Word Mail Merge - On Database Switchboard

Mar 9, 2008

I've got a mail merge letter in word using a booking system which I've built in Access, and I want to be able to access the mail merge letter (or the letter template) through that switchboard. Is this through running a certain macro, and if so, can anybody tell me what it is?

View 1 Replies View Related

Automate Mail Merge Function From Access Database

Apr 23, 2013

I have a database, i need to automate mail merge function from access DB to insert selected records into the merge fields, i have tried everything i could and i have searched through out the web nothing really works for me.

View 1 Replies View Related

Modules & VBA :: Mail Merge From Report?

Aug 7, 2013

I have a report in my database with a button called "MailMerge".

My aim is that when clicked, this will open a word document, that has already been created, but automatically complete the merge based on the data in a table.

The catches:

1) I need to be able to ask the user the content of the word document from within access, and automatically populate it

2) I need to be able to ask the user who has written the word document and automatically populate it

3) I need to use a document which I have already created, because of various reasons, but obviously the merge fields can be updated.

Currently, I am trying to append the results of the query into a table, TBL_Merge and then use code to both ask the questions above, and then complete the merge.

View 1 Replies View Related

Modules & VBA :: Mail Merge With Attachment?

Jun 19, 2014

I'm wondering if it's possible to set up an automatic Outlook mail merge with attachments from Access. We have several account managers, and each one receives a different version of the same report - filtered to his/her accounts. For now, I have set it up for the user to select the account managers and hit "Print Reports" to save each individual report into a destination folder. The user then uses an email template, attaches the report, and sends the email to an account manager. She has to send this email separately to each account manager.

View 3 Replies View Related

Modules & VBA :: Mail Merge From Multiple Users?

Jun 11, 2014

I know this is possible (e.g. opendatasource) but search as I might I can't get the exact code.

Scenario: Multiple front ends, in different folders, linked to single back end.

When mail merging, a temp table is created in FE - thereby different source for each user.

The Word doct is linked to a source (via Mail Merge) and I want to change that source according to the logon of the user, which is held on an open form.

Ideally like:
Case Mary use C: Db1 emptable
Case Tom use C:Db2 emptable

View 4 Replies View Related

Modules & VBA :: Mail Merge For Single Record

Feb 18, 2015

I have an access .adp project which is linked to a sql server tables (2008 r2), I have a button on an access form which I click and successfully gets customer details based on a query. What I wanted to know is when I am viewing a specific record i.e. details for Patient Number X, when I click on a mail merge button from their record form can the mail merge document only open with their details not all customers?

I have tried to delve into vba and modules to acheive this but I am a newbie.

View 4 Replies View Related

Modules & VBA :: Mail Merge With Variable File Name

Aug 14, 2013

I might be able to get "super easy mail merge" to work, but the problem is i want clicking the "merge" button to launch a file chooser box- so i can navigate to the word doc i want to use for the merge (destination doc will change with the currently selected record- i'm not merging a single record, however).

Basically i want to do exactly what right clicking on a table/query, then choosing "export" then choosing "merge with word" does (access 2007).

Can't do as a report because we may have "complex" letters- with graphics and/or tables.

why is something that is a simple right-click menu option so difficult to automate??

View 4 Replies View Related

Modules & VBA :: Creating Mail Merge Letter

Aug 20, 2013

I basically have a form which the record source is either from a table or query and all I would like to do is to have a button which when pressed will open up a previously created word template and insert all relevant fields into the template. First Name, Last Name, Address etc.

View 1 Replies View Related

Database Locked By User

Jul 25, 2007

I have a 2000/2003 format database used only for reporting.

It has linked tables to an SQL Server database.

It automatically opens a form with two buttons on it (no data) and hides the database window and the regular menu, replacing it with my own toolbar.

The default open mode for the database is "Shared."
The default record locking for the database is "No Locks"
On the opening form, the record locking is set to "no locks."

Yesterday, no problem for two of us to share it.

However, when I open it on my computer (not to edit - to use. I simply open it - not in exclusive mode.), and then another person opens it, they get the message that says "the database has been placed in a state by "Admin" on machine (my machine) that is locked and will not be able to be opened." (not verbatim, but close.)

When the other person opens it first and then I try to open it, I get a message that I don't have exclusive access and will not be able to save changes. I have to hit okay about 6 times, but then it opens.

Some users at off-site locations are having problems sharing - some are not.

Any ideas?

View 3 Replies View Related

Modules & VBA :: Mail Merge And Create Individual Files

Jan 11, 2014

I am looking to perform a mail merge from access to Publisher. I have linked everything together and got everything looking the way that I want it to look however...

What I want to do is when I perform the mail merge I would like publisher to save a copy of each individual record from the database as a specific file based on one field of the mail merge.

I will try to clarify...

One of the mail merge fields is ClientAccountNumber I would like the merge to save a copy of the publisher file into c:mailmerge as a PDF including the year 2014.

So this file(s)for example would look like
C:mailmerge123456 - 2014.pdf C:mailmerge123457 - 2014.pdf etc...

Code:
Sub MailMerge()
'
' Macro1 Macro
Dim TempDocCreate
Dim FileNameTemp As MailMergeDataField
Set FileNameTemp = Application.ActiveDocument.MailMerge.DataSource.DataFields.Item("Box 22 Rcp Acct No")
With ActiveDocument.MailMerge.DataSource
Application.ActiveDocument.ExportAsFixedFormat pbFixedFormatTypePDF, Filename:= _
"L:Operations DatabaseProjects1042PublisherPDF2011 Merge" & "FileNameTemp" & " - 2011" & ".pdf"
End With

View 6 Replies View Related

Modules & VBA :: Mail Merge In MS Word (using Data From MS Access)

Mar 9, 2014

I often create contract using mail merge. I have an access file that I want to use as data source for word file. But it does not automatically.

Please see the attached file !

If there are 1 customer and 1 property, I do not need to do anything. Conversely, if there are many customers and many properties, I take time to manipulate.

Firstly, I open the word file. I have to copy and paste paragraphs that I want. Highlight of the original paragraphs is blue.

Secondly, I click 'Insert Word Field' -> select 'Next Record'.

In short, I want to use VBA in access file to automatically perform the steps that I have outlined.

View 1 Replies View Related

Modules & VBA :: Losing Decimal Place In Mail Merge

Sep 4, 2013

My DB is merge in a currency field set to 2 decimal places into word. It's doing this by declaring the fields as variable, calling an instance of work then dropping the values into the bookmarks. All works fine....

When a value is 360.64 is fine, but when it's something that ends with a 0 (360.60) - is loses the 0 giving me 360.6.

View 2 Replies View Related

Modules & VBA :: Recreate Old-style Parameter Query Mail Merge

Sep 15, 2014

I am trying to create VBA code (I have very little experience of VBA) to recreate a parameter query mail merge, which Access 2013 cannot achieve with the controls provided.I think that I need to assign a variable to the value of a control on my form then assign that variable to the relevant criteria section of my query.

Code:
DIM RefNo as String
DIM IDNo as String
RefNo = Me.[Reference Number].Value
IDNo = Me.Text582.Value
DoCmd.OpenQuery SORTER
How do you paste into criteria?

From there I would like to do a Word Mail Merge by having VBA open a document in Word, then activate the Merge to a New Document instruction.

View 14 Replies View Related

Modules & VBA :: Fine Calculation - Supply Data For Mail Merge

Mar 18, 2014

I am currently working o a Library Management System. most of the work is done but there remains two major problems.

I want to calculate the fines that a member will have automatically on a form. i have a basic pseudocose which is

IF Loan.returned=0 AND ReturnDate<Today{note- i.e. date()Today(), etc.}
THEN Loan.fine_BDT=20*(Today-Loan.ReturnDate)
Note2- The form has the following fields from a query which is connected to table loan-
LoanID
LoanDate
ItemID
MemberID
ReturnDate
DateReturned
Returned(Yes/no)

2. The other one is with the Mail merge. i Want to use a query to supply the data for a mail merge. However, since the database id encrypted with a password it cannot be reached.

I am currently using Access 2007.

View 7 Replies View Related

The Database Has Been Placed In State By User "Admin"

Mar 13, 2007

hi,

Everyone know this error? the database has been placed in state by user "Admin"!

We are using a shared database in Access 2003 that is still in Access 2000
format. When more than one user has the database open (by using the vb.net), the following error
message appears "The
database has been placed in a state by user 'Admin' on machine XXXXX that
prevents it from being opened or locked."

How to slove this error? please help! Urgent!:confused:

View 3 Replies View Related

Modules & VBA :: Text Box Change Event Prevents Updating?

Jun 18, 2013

Currently I have an issue where on of the fields in a userForm will not update. I have tracked down the problem to an update Event procedure

Code:
Private Sub txtRate_Change()
Me.txtSales = Me.txtRate * Me.txtPages
Me.txtGST = Me.txtSales * 0.1
Me.txtTotal_Inv = Me.txtSales + Me.txtGST
End Sub

The idea being, when you update the rate, the Sales/Revenue figure will update based on that rate. For a while this seemed to work fine. but recently , it just will not allow me to update the field txtRate, I cannot understand why. I have now replaced the _Change() event for a _LostFocus() event. but I am not sure that is as reliable, and I am still puzzled / worried as to why the _Change event will not work.I'm on Access 2013, win 7 , using a front end db connected to the back end using linked tables.

View 8 Replies View Related

Modules & VBA :: Locked Database - Login Security With Created Form

Jun 18, 2013

I am looking to lock my database until the user puts in the correct credentials.

I have already put the form on Pop Up and Modal. They can still select the "X" in the top right of the window.

View 1 Replies View Related

Modules & VBA :: Word Document Load When User Click Button And Perform Email Merge

Oct 7, 2013

I have a Word 2010 document linked to an Access 2010 data source. When a user clicks a button in Access, the Word document loads and performs a email merge using the below VBA code:

Private Sub Document_Open()
With ActiveDocument.MailMerge
.Destination = wdSendToEmail
.SuppressBlankLines = True

[Code] ....

However, as the .mailsubject part is not in the loop it is only retrieving the first Return Code. I have tried to integrate in the loop to no avail. Also, how do I add static text to the Subject, I need something like "Your Return Code" + "Return Code"..

View 6 Replies View Related

Using Cc: With Mail Merge

Jul 20, 2005

When applicable, I have letters in Word already set up to show the cc: information at the bottom. However, Management needs a statement added to the bottom of the letters that ONLY show the cc:

I am having a slight problem trying to figure out how to make this statement show up only on certain letters.

Does anyone have any thoughts that could help me? I'd appreciate it very much.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved