Mailmerge And Security
Dec 22, 2006
I am using Access 2003 and have secured my database, so that it now consists of an .mdb and an .mdw file. The .mdb is opened using the security settings in .mdw using a shortcut.
I want to set up a mail merge into Word 2003, but whenever I try selecting my database as the source of the data I want to merge, it won't let me log in.
Can anyone advise me how I can get this to work correctly?
Thanks,
Gary
View Replies
ADVERTISEMENT
Apr 4, 2007
Dear Guru,
I have an issue which having read some previous threads may not be resolved simply. My database is password protected.
The password (presumably) is preventing the mailmerge from connecting the deata with the template. There is not even a password request shown. Is there any way that this can be overcome. There are a number of mailmerges but all are pulled from the same data query, can i unprotect this query only??
After convincing my boss that the dbase can easily run securely, your help will be very much appreciated.
Yours
Andrew - In sunny Hull, UK.
View 2 Replies
View Related
Jun 4, 2005
I have started having problems with MailMerge in my database - it has worked before but now I get this error:
Runtime error 5922
"Word was unable to open data source"
Here is my code:
Function MailMerge(strMMTemplate As String)
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Open(fldMailmerge & strMMTemplate)
'Make Word visible.
objWord.Application.Visible = True
'Set the mail merge data source
objDoc.MailMerge.OpenDataSource Name:="C:cmoscmos.mdb", LinkToSource:=True, Connection:="TABLE tblMailMerge_Temp_Full", SQLStatement:="SELECT * FROM tblMailMerge_Temp_Full"
'Execute the mail merge.
objDoc.MailMerge.Execute
objDoc.Close
Set objWord = Nothing
Set objDoc = Nothing
End Function
I have searched high an low through the forum and web - but no luck.
Any ideas? I am running Access 2003.
Cheers
Will
View 4 Replies
View Related
Mar 2, 2006
Hi
Can anyone help?
I am trying to perform a mail merge from Access database table and using Word letter setup with all the necessary variables.
I am using VBA in access to perform this task.
All works ok to the point but the first snag I had when
the Access was not open in Read-Only mode and where
'OpenDataSource' statement was refusing to merge the database to the letter
I managed to overcome this by opening Access in Read-Only mode.
However I hit the second snag.
When running 'OpenDataSource' statement the pop up box comes with option to select a table I want to make connection too.
The table is listed in the within the parameters for the statement, so it does not make sense why is this question.
This is my code:-
Dim WordApp As Word.Application
Set WordApp = CreateObject("Word.Application")
MergePATH = Application.CurrentProject.Path & ""
With WordApp
.DisplayAlerts = wdAlertsNone
.Visible = False
.Documents.Open (MergePATH & "MTSheet3.DOC")
With WordApp.ActiveDocument.MailMerge
.OpenDataSource _
Name:=MergePATH & "io.mdb", _
LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="TABLE tmpTable"
.Destination = wdSendToNewDocument
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute
End With
.ActiveDocument.SaveAs (MergePATH & "Dummy.doc")
.ActiveDocument.Saved = True
.ActiveDocument.Close
.Quit
End With
Set WordApp = Nothing
Can anyone explain what the problem ?
Thanks
The is holding up progress of a big project
View 3 Replies
View Related
May 21, 2005
Hi,
the problem i have is this -
i have a stores database for all items in a warehouse. i need to be able to have a button on my form that sends the current record to a word template to be printed out on labels. i need to be able to specify the amount of labels for each record, and i need to be able to send multiple records to the same template. i have absolutely no idea how to do this.
ive got the template set up, but currently it is mailmerged the normal way, meaning it would just print every record in the DB on the labels. i was thinking of having some kind of check box in the DB so that the user can use the form to find all the records they want to print, check the box for each (and also enter a number for the amount of times they want that record printing on the sheet) and then have a button to send the final document to the printer. this brings up another issue - how do i empty the check box for every record each time the form is used so that all the previously printed records do not get reprinted?
If anyone has got any idea how to overcome any of these problems i would be extremely grateful.
Thanks
View 1 Replies
View Related
May 21, 2012
In my database which is used by a charity I have a button which opens a mailmerge email document in MS Word using the following Visual Basic code -
FollowHyperlink "C:Our FoldersBWMCJuly Donors Email.docx", , True, True
This mailmerge document draws its personal information from a query in my database. And sends off personal emails to a number of donors.
I want to attach a personal document called 'Allocations.docx' which is also a mailmerge document drawing its personal information from the same query. How can I automate the attachment of this document to the email so that each donor gets their own email plus their own attachment?
Can something be added to the existing line of VB which will do what I want? If so, what do I need to add?
View 8 Replies
View Related
Jul 28, 2005
I just started having an issue with a mailmerge launching form in Access. A button I've set up, called "Order Form," uses the following code to launch Word, merge the data into the document, save the document, and close out the template. It's a large sample, and I think it may have come from this website at some point last year:
<---------START--------->
Private Sub OrderForm_Click()
'creates an SQL statement to be used in a query def
'On Error GoTo ErrorHandler
Dim val As String
Dim db As Database
Dim rec As DAO.Recordset
Dim strSQL As String
Dim strDocumentName As String 'name of the template document
Set db = CurrentDb
Set rec = db.OpenRecordset("SELECT Order_ID FROM tmpCurrentTGOrderID;")
While Not rec.EOF
val = rec("Order_ID")
rec.MoveNext
Wend
rec.Close
'Select all records from the record table were the table's Order_ID field matches
'that of the temporary table's.
'qry = "SELECT TG_Orders.Order_ID, TG_Orders.Order_Date, TG_Orders.Order_HonoredPerson, TG_Orders.Order_TreeGiver, TG_Orders.Order_PlantingState, TG_Orders.Order_Product, TG_Orders.Order_Type, TG_Orders.Order_Line1, TG_Orders.Order_Line2, TG_Orders.Order_Card, TG_Orders.Order_Occasion, TG_Orders.Order_First, TG_Orders.Order_Middle, TG_Orders.Order_Last, TG_Orders.Order_Have, TG_Orders.Order_Digits, TG_Orders.Order_CardType, TG_Orders.Order_Comments, TG_Orders.Order_Donate, TG_Customers.*, TG_Shipping.* FROM (TG_Customers INNER JOIN TG_Orders ON TG_Customers.Customer_ID = TG_Orders.Customer_ID) INNER JOIN TG_Shipping ON TG_Orders.Order_ID = TG_Shipping.Order_ID;"
strDocumentName = "TG_OrderForm.doc"
strSQL = "SELECT TG_Orders.Order_ID, TG_Orders.Order_Date, TG_Orders.Order_Confirmation, TG_Orders.Order_HonoredPerson, TG_Orders.Order_TreeGiver, TG_Orders.Order_PlantingState, TG_Orders.Order_Product, TG_Orders.Order_Type, TG_Orders.Order_Line1, TG_Orders.Order_Line2, TG_Orders.Order_Card, TG_Orders.Order_Occasion, TG_Orders.Order_First, TG_Orders.Order_Middle, TG_Orders.Order_Last, TG_Orders.Order_Have, TG_Orders.Order_Digits, TG_Orders.Order_CardType, TG_Orders.Order_Comments, TG_Orders.Order_Donate, TG_Customers.*, TG_Shipping.*, TG_Orders.Order_Cost, TG_Orders.Order_Remembrance "
strSQL = strSQL + "FROM (TG_Customers INNER JOIN TG_Orders ON TG_Customers.Customer_ID=TG_Orders.Customer_ID) INNER JOIN TG_Shipping ON TG_Orders.Order_ID=TG_Shipping.Order_ID "
strSQL = strSQL + "WHERE TG_Orders.Order_ID=" + val
Call SetQuery("TG_OrderFormQuery", strSQL)
Dim strNewName As String 'name to save merged document as
strNewName = "Order " & Format(CStr(Date), "MMM dd yyyy")
Call OpenMergedDoc(strDocumentName, strSQL, strNewName)
Exit Sub
ErrorHandler:
MsgBox "Error #" & Err.Number & " occurred. " & Err.Description, vbOKOnly, "Error"
Exit Sub
End Sub
Private Sub SetQuery(strQueryName As String, strSQL As String)
On Error GoTo ErrorHandler
'set the query from which the merge document will pull its info
Dim qdfNewQueryDef As QueryDef
Set qdfNewQueryDef = CurrentDb.QueryDefs(strQueryName)
qdfNewQueryDef.SQL = strSQL
qdfNewQueryDef.Close
RefreshDatabaseWindow
Exit Sub
ErrorHandler:
MsgBox "Error #" & Err.Number & " occurred. " & Err.Description, vbOKOnly, "Error"
Exit Sub
End Sub
Private Sub OpenMergedDoc(strDocName As String, strSQL As String, strReportType As String)
On Error GoTo WordError
'opens an instance of word, opens a merge template which has its data source
'already linked to a query in this database, merges the template,
'saves the merged file with a descriptive name, then closes the merge template
'Set the directory for any labels generated
Const strDir As String = "D:LOA-DataMerge Templates"
Dim objWord As New Word.Application
Dim objDoc As Word.Document
objWord.Application.Visible = True
Set objDoc = objWord.Documents.Open(strDir & strDocName)
' Make Word visible so that if any errors occur, you can close the instance of Word manually
objWord.Application.Visible = True
'merge to a new document
'if you are not sure of the SQLStatement to use in your OpenDataSource string, uncomment the following four lines to have the 'current SQLstatement print in the immediate window. You can then copy the returned string to your code
'Debug.Print objWord.Application.ActiveDocument.MailMerge.DataS ource.QueryString
'objWord.Quit
'Set objWord = Nothing
'Exit Sub
objDoc.MailMerge.OpenDataSource _
name:="D:LOA-DataLOAv817.mdb", _
LinkToSource:=True, AddToRecentFiles:=False, _
Connection:="QUERY TG_OrderFormQuery", _
SQLStatement:="SELECT * FROM `TG_OrderFormQuery`"
'notice that this is not the SQL statement that makes up the QueryDef of the query. It
'is the SQL statement that tells Word whether to use all the records returned by the
'Query. Notice also the funky single quotes – this is what DataSource.QueryString returned
'to me in the immediate window. I’ve also seen the query name written in 'brackets [ ],
'but have never tested this code with them.
objDoc.MailMerge.Destination = wdSendToNewDocument
objDoc.MailMerge.Execute
'save the merged document with a descriptive name
'you can delete this line if you want to leave the document with the default name “Labels 1” or “Letters 1”
objWord.Application.Documents(1).SaveAs (strDir & "" & strReportType & ".doc")
'close the merge template
objWord.Application.Documents(2).Close wdDoNotSaveChanges
'release the variables
Set objWord = Nothing
Set objDoc = Nothing
Exit Sub
WordError:
MsgBox "Err #" & Err.Number & " occurred." & Err.Description, vbOKOnly, "Word Error"
objWord.Quit
End Sub
<---------END--------->
Just today, this code started auto-minimizing the MS Word window, causing user error (after the documents been minimized, instead of clicking on the task bar, the user would click the button again, prompting that the document is already in use, would you like to save changes before closing the document, etc). Is there anything in this code that is telling Word to minimize? It's only happening on this one button, and there are 7 other mailmerge buttons on the same form, using the same code, that work fine.
Any help would be greatly appreciated,
Nate
View 1 Replies
View Related
Dec 27, 2007
I am trying to generate letters from ACC2003 db into Word2003. Reason for Word is so client can edit letters if required.
I have set up a maketable query to generate a temporary table in the Db and the mailmerge master document all formatted and pointed at the temporary table. I still need to get the automation running so that the letters merge and print on a command button.
My immediate issue is that the address lines are intentionally spread across 5 fields Addr1, Addr2, Addr3, Town, Postcode. Not all fields in every record are full, and with the query it would be impossible to eliminate fields on the chance they might be empty.
As a result my mailmerge has blank address lines which do not look professional.
Can anyone point me to how I might solve this given my proposed use - if it was a report then I have a little code module that neatly eliminates blank lines but I cannot see how I could integrate this into the mailmerge process.
Thanks for any help or pointers
View 2 Replies
View Related
Nov 25, 2014
I have a database of film events, for which i have to do posters.
With the click of a button on a form, access opens word and puts all the fields in, including a field called [photo], which is the name of the image stored outside of the database.
Is there a way of getting that image into the word Document with all the other fields? Or have I just wasted an afternoon....
View 2 Replies
View Related
May 25, 2014
I'm looking to add a button to my Customers form which will mailmerge the current record to a Word template and then save the Word doc as a new file (Ideally the customer's name).
I've looked at the Super Easy Mailmerge but I can't work out how to implement it without all of the variables (selecting documents etc.).
The files will all be saved to one location (C:CustomersExports) and this won't change.
This is also the location of the mailmerge template (C:CustomersExportsTemplate.docx)
View 9 Replies
View Related
Aug 5, 2013
I am having the strangest results with my automated mailmerge. Basically it does work, but not all the time. The basic idea is to allow the user to dynamically create a query that produces a result list which fills a temporary table. The use then selects a prebuilt merge template and merge is executed against the temp table. The merge template are of the .doc type, but sme have been converted to .docx; the .doc files tend to work most often, but all of the will eventually get a Table is locked message... However if I run in test mode with code breaks and manually step through the process it always works... here is the heart of the code ...
Err_Pos = 10
Code:
DoCmd.SetWarnings False
' if tmp tbl left over from last run kill it
DoCmd.RunSQL "Drop table Word_Merge_Tmp_TBL"
Err_Pos = 12
[Code].....
There are many error cases in the error catch routine. That I have managed to make Access stop hanging when word has a problem or the table is locked. But I can't get the table to be free consistantly and why does it always work when I manually step through the code.
View 4 Replies
View Related
Mar 26, 2007
I've read and gone though quite a few of the scrips and examples for creating logins and security and i'm getting to the stage when i need to have good understanding of the different methods.
Some of the examples whilst create a user login do not really allow for security within the database whilst the build in security wizard would appear to offer that functionality.
I am thinking that I will use the Workgroup file and that method. My question is am i able to utilise the fact that if a person 'AdamA' logs onto the database which is built into the workgroup security file. am I then able to take 'AdamA' to populate a table which records actions by a user? (I can't seem to find any thread or book reference to doing this)
View 4 Replies
View Related
Oct 26, 2011
Is it possible to do this through vba. If security is setup for all the tables and a user goes in and creates a new table, can that table have security applied to it using code?
So maybe the creator of the table has read/write privileges but everyone else only has read only.
View 3 Replies
View Related
Jul 1, 2005
:confused: I can't access my database. I used many tools to scan my database password, and I had many results but I can't used any one.
This's my database. Can you help me?
View 1 Replies
View Related
Aug 28, 2005
Hi
I am experimenting in creating security of a database, and elements within.
I started by creating a user account with a password. I then made a few mistakes, so wanted to delete the mdb, and start again.
However, when I now try to create a new database, or even open a pre existing database, I am asked for the user and password created in the now-deleted mdb.
Apart from the fact that it shouldn't ask for the user name and pasword created in the first database, I am sure it doesn't accept the password I intered in creating the account.
The easy solution would be to delete the file where Access stores user accounts. Where is it, and is it protected, such that I can't delete it? And even if the user name and password still exists somewhere, it should only apply to the database in which it was created, shouldn't it?
Thanks
Robert
View 2 Replies
View Related
Nov 10, 2005
Hi all,
Just looking for a little advice on data protection. I have a split database which is accessed from the front end (forms only). All data is stored on the back end, which is hidden away from the user.
The database is password protected, and both sides use a login authentication to avoid unwanted access. However, the usernames and passwords are easily retrievable by opening the database a text document.
Any ideas on how to make this more secure?
Cheers
sys
View 1 Replies
View Related
Dec 3, 2005
I try to play Security.
After I created it, the shortcut is created on the screen.
Everytime needs to click the shortcut to login it.
But, when I go to database file, and then click it, it does not work, it will show the following message:
You do not have the necessary permissions to use the <name> object. Have your system administrator or the person who created this object establish the appropriate permissions for you. (Error 3033)
You do not have the necessary permissions for the specified object. To change your permission assignments, see your system administrator or the object's creator.
So, is it ony the shortcut to login it?
if delete the shortcut uncarefully, how to do it??
Thanks.
View 2 Replies
View Related
Dec 7, 2005
Hi,
Problem 1:
I setup a security, stored the security file and other files in the drive D:
it works.
after I move the files to the drive C:, then it doesn't work.
Why it doesn't work?
Problem 2:
After I created security, there are acc.mdb, acc.bak, and Secured files, right.
how can I add this link:
"C:Program FilesMicrosoft OfficeOffice10MSACCESS.EXE" "D:acc.mdb" /WRKGRP "D:Secured.mdw" in the target to the acc.mdb file.
Because when it doesn't work, and then I created a shortcut of the acc.mdb file, then add the above code. Then it works, it give out the prompt.
Does any method instead of this, better than this?
Please let me know, thanks.
View 1 Replies
View Related
Dec 14, 2005
Hi
When using security login, can we logout and then login to the database without shutting down the database and re-opening.
Such as using a button to logout and then another to login.
Dave
View 2 Replies
View Related
Jan 17, 2006
Can some one help me?
I am trying to set up a database in which the the table portion is password protected but the query section can be manipulated or updated as users see fit. Does anyone know how to do this?
Thanks, S
View 1 Replies
View Related
May 5, 2006
Hi,
I have now finished my system that will run on a windows network. I now need to get the security setup so different users can access different pages.
I have set a list of users and specified what forms/tables they can access. The problem is, how does access know who is accessing the pages? For example, i have set 2 users - Dave G & Dave S - I have given Dave G access to the admin forms as he is the admin and I have given Dave S access to the general data input forms.
How is this enforced? How does access know which person is opening the forms. Unless access asks the user to login using their user name set in access, I cannot see how it can manage what users can do what.
Thanks
View 3 Replies
View Related
Jul 18, 2006
I have locked down my welding data base and had some problems arise mabe someone eles has had this problem. All of the tables in other data base that are linked to the welding data base now will not allow me to utilize them I get the error message that I do not have rights too that information. Even though I have full access rights to the welding data base and can make changes at will.
Why can't I do any thing to the others? HELP!!!!!
View 5 Replies
View Related
Aug 18, 2006
First of all, i am pretty new to this....
We have a few access databases in a network. More and more people in our organization are using the databases so I am learning to create some user-level security.
We have access 2000.
Access links to a WIF to create user-level security.
But I think there is an easy way that anyone can get pass that.
Even if I have set all the groups and users privileges and restrictions, anyone can simply switch from one WIF to another WIF, then they would have changed all their privileges and restrictions.
Am I understanding this correctly?
If so, what can I do better secure the database.
Another question:
How can I prevent someone from simply copy/delete the access file from windows? I am afraid that someone, maybe a disgruntled employee or even myself making stupid mistakes, delete the whole access .mdb file, and I would loss everything.
I do backup the file, but even if I back it up every night, if something like this happens, i would have lost a whole day of work.
Your advice are highly appreciated.
Thank you all for your help.
View 1 Replies
View Related
Aug 22, 2006
Hi,
I followed the security wizard and everything worked fine. However, when I move the database to another computer or another folder, it prints this message:
'You don't have the necessary permission to use (path)...'
Is there anyway to avoid this please?
Thanks,
B
View 14 Replies
View Related
Nov 22, 2006
Access security is really very confusing, thought I had conquered it but I was wrong. I have been playing with a test DB. How on earth do you reset a password for a user? I just can't see where you go to assign a new password.
Managed to clear the password but then got stuck.
Cheers
RussG
View 2 Replies
View Related
Dec 12, 2006
Hi,
I have a question for user-level security and workgroup.
Suppose we setup user-level security and have a workgroup with storing all username, password, and groups,
if adminstrator want to change one user permission, let's say that change the user permission from update to read permission only, then the user should only have read permission, right. However, previously, the user copied the workgroup file himself before adminstrator change his permission, if he apply to his copied workgroup file, and log in the database, he can still have update permission.
So, how do I prevent the user using his copied workgroup file for the database?
How can I solve it?
Thanks.
View 4 Replies
View Related