merging and shift-bypassing problem

TjS

Registered User.
Local time
Today, 21:37
Joined
Jul 18, 2007
Messages
126
I have a problem, which i cannot solve:

1st: i created a [shift]-bypass module and behind a textbox a code which if doubleclicked a password is asked, to disable or enable the [SHIFT] key for opening the db the next time it is started up (found in a trhead here somewhere how to)
2nd: i have a module in which i have put the code for merging a query with a template in word, this code is behind a button in a form

My problem is as follows:
When opening the db in edit-mode (enable shift, and holding it to open the db); all forms, queries etc. are of course visible,
then opening the form, pushing the button results in the mergedocument with the correct information

BUT

When opening the db in read-mode (disable shift, which results that users cannot view, reach, write, etc..; no forms, queries and so on are visible)
and opening the form, pushing the button results in a requestioning of the parameters used in the query, continuing opening the word-template, further more there is an error coming up [could not lock file]; access is started up again......

Has anyone got ideas how to solve this problem?

Even when i now have deleted the SHIFT]-bypass modules and code behind the text, the problem remains that holding shift results in the correct mergedocument (without requestioning the parametervalues) and opening the db without SHIFT (allthough everything is visible, writable etc) resulting in the requestioning of the parameter values and errors [could not lock file].

I will continue sorting out my problem, but if anyone could assist me with it i would be most gratefull.

Thanks in advance
 
one thing sorted out (problem is not SHIFT Bypass)

The problem with the locking had (as far as i could tell) nothing to do with the SHIFT Bypass procedure.

In the mailmerge module i had, instead of an InPutbox ("please give location of template"), i had put a form textbox there ([forms]![fName]![tbName], in the textbox i have made it possible to enter the location (with an open word document procedure); this because we would like the user to use different templates (with same queries)

One problem does remain though:
the parameter which are mentioned in the querie does come up each time the merging is starting. I have checked it, and the parameters which i filled in at the query do match the textboxes or other information on the form.
 
exclusive lock - how to link without locking

I sorted the problem with the parameter values out, in some part which i overlooked, the old parameter came forward, which caused the query to ask for all parameter values.

My last problem:
In the following code i have set the link to source part on false, the result is that when merging the access database is opened as a new version whenever the word-template is opened. When i put it to variable TRUE, the result is that i get an error saying "could not lock file".

What i actually want is that the word template is opened, the query is called and the data is being merged, without opening or locking the db....
(by the way, the db has no exclusive lock, but shared and also no record lock)

Code:
Option Compare Database
Option Explicit

Function MergeIt2()

Dim objWord As New Word.Document
Dim strSQL As String
Dim strInput As String
strInput = [Forms]![5010 Template]![Attachment]

Set objWord = GetObject(strInput, "Word.Document")
 'Make Word visible.
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
[B]LinkToSource:=False, _[/B]
Connection:="Query  queryname"
' execute the mail merge
objWord.MailMerge.Execute


End Function

Please advise,

Thanks in advance
 
..thought my problem with the parameter values was over...

it really ....

I first had the bypass procedure left out, so i could sort out the problem with the locks and everything.

Now i made the bypass procedure again, and at "startup" disabled all checkboxes, so that whenever the user starts the access application the mainmenu is coming up.

Then i went for the ultimate test....but.....there are my parameter values again....

Filling the parameter values results in the correct information on my merge document, this time all the parameters are what they need to be (yeppers, i am sure, checked my query in combination with the form).

What could be the problem?
 
solved (!)

Thanks to googling around the world, i found a side effect which appearantly caused my problem as well.

(found the answer in a discussiongroup of google about mailmerging access and word)

There seem to be a problem in acees 95, 97 with the automation of mailmerge whcih starts a new instance of access.

In my case, although access 2000 is installed, the information couldn't be reached in my access database because it just couldn't find the forms or parameter values.

Read the following for an explanation and solvation:

http://www.mvps.org/access/bugs/bugs0011.htm

Maybe other people can use this solution
 

Users who are viewing this thread

Back
Top Bottom