Database file for populating cascading combo box error

S

SuzyQ

I followed Greg Maxey's helpful instructions on List and Combo Boxes to
create a template that loads a form when the user creates a new document.
This form allow them to choose either a fax/letterhead and insert the
appropriate address for the user. The address combo boxes are populated from
a table in a Word document. This template will be used across 15 offices so I
located the Word file on our server where it could be accessed by all.

However, the database file comes up as read-only (by the last person to
access it) whenever my test users try to access it. While you can push
through and get the combo boxes to populate the Read Only msg comes up about
three or four times during the process.

Is there a way around this problem - or is it a security setting that my IT
department has to change?
 
G

Greg Maxey

This is just a stab because I don't have a server and I know nothing about
there behavior. You might use

Application.DisplayAlerts = wdAlertsNone
'The code
Application.DisplayAlerts = wdAlertsAll

to masks and block the alerts from appearing.
 
G

Gordon Bentley-Mix

It shouldn't really make a difference if the file is located on a server or
not, nor should it matter if the users only have read access to the
location. I use this method in an similar environment and have no problems;
the file is located in the Workgroup templates folder, which is on a network
share that only certain people have full access to.

Since SuzyQ said that the warning mentions something about the last user to
access the file (which makes me believe that the message actually says that
the file is locked and asks if the user wants to open it as 'read-only') I
wonder if the file is being closed properly after use. Perhaps it is being
held open until code execution is complete?

SuzyQ, can you provide a bit more information? What does the warning
actually say? Does the first user get this warning or only the subsequent
users? Can you please post the relevant bits of your code so we can see how
(and when) you are opening and closing your source document?
 
S

SuzyQ

My file is located on a common drive and everyone has read/write access to
that. As the Workgroup folder is "hidden" from the majority of staff I didn't
think it was possible to link there.

Gordon you are correct about the warning - here is my replica of the message:

_______________________________________________
File in Use

MyFile.doc is locked for editing by 'susan.quinn'

Do you want to

* Open a Read Only copy
Create a local copy...
Receive notificatin when the original copy is available
___________________________________________________

Subsequent users get this message and in one test long after I had closed
out of word completely.

This is the code for the Userform initailise:

Private Sub UserForm_Initialize()

cmbt2loc.Visible = False
Set Source =
Documents.Open("\\talent2.corp\common\Templates\Resources\OfficeLocationsStationery.doc", Visible:=False)
Set stable = Source.Tables(1)

For i = 2 To stable.Rows.Count
Set ritem = stable.Cell(i, 1).Range
ritem.End = ritem.End - 1
cmbt2div.AddItem ritem
Next i

Source.Close wdDoNotSaveChanges
Set Source = Nothing
Set stable = Nothing
End Sub

Thank you for your help with this. I have been having lots of trouble
posting to this Discussion Group over the last few months so there may be the
same post under another name

Susan
 
S

SuzyQ

Just to let you know a programmer in one of Asian offices suggested adding
ReadOnly:=True to the code and it fixes the problem.

Set Source =
Documents.Open("\\talent2.corp\common\Templates\Resources\MyFile.doc",
ReadOnly:=True, Visible:=False)

Thank you for your help.

Susan
 
G

Gordon Bentley-Mix

Susan,

Interesting workaround - not one that I would have though of. I use almost
identical code to your original (the only difference being that my source
document is password protected so I supply a password when I open it), and I
have absolutely no problems whatsoever. I wonder if there's something about
your environment that causing the file to remain locked even after it's
apparently been released. No matter. Looks like you've found a solution so
we'll just let it be.

As for the problems you've been having seeing your posts, a lot depends on
what you're using as a 'client'. If you're going through the MSFT
Communities website, you should be aware that this portal has caused a lot
of problems for many people in the past. For web access, I've heard the
Google Groups is much better, and even OfficeKB doesn't seem to have as many
problems as the MSFT site. Personally, I prefer a newsreader. My weapon of
choice is Windows Live Mail, although there are several others to choose
from. Of course, this can be problematic in a corporate environment when
installing and using newsreader software is often strictly prohibited. In
this instance web access is usually your only option, but I'd recommend
trying different routes until you find one that works better than the one
you're currently using - starting with Google Groups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top