Close "connection" or unload or whatever???

Steff_DK

Registered User.
Local time
Today, 19:55
Joined
Feb 12, 2005
Messages
110
I have a couple of forms with the same source - or rather sources are different queries accessing the same table.

Both forms have edits allowed.

My problem is that when I have had one of the forms open, the second form cannot get its data when I load it ... Even if I do a:
Code:
DoCmd.Close acForm "Form1"
-on the first form

If I open one or two forms accessing another table in between there are no problems???

It seems somehow that the connection is "hanging" somewhere. :o
How can I make sure that Form1 is closed and completely out of the system, so my form2 can get its records?? :confused:

Btw there are no problems if the forms haven't got edit allowed due to calculated fields ...
 
Unless you make provisions otherwise, the forms are probably fetching the same record when they open. How do you have the Record Locks set on the Data Tab of the properties sheet for each form?
 
Record locks: All records.

What does the record lock property do exactly?
 
Access is inherently multi-user. The record locking is there to arbitrate who wins when two users try to modify the same record at the same time. I would change your Record Locks to Edited Records on both forms and see what happens. You can go to Tools>Options>Advanced tab and set the default action for your db on the right side of that tab.
 
Tried changing record locks to: None
Now it works!!! :D :D :D

Been battling this for 3 days ...
Thanks RG!

(What probs will I potentially run into with no locks?)
 
If you are just working on a single user system and will *never* be multi-user, then I would venture you will not see any problems. Otherwise, set it to Edited Records and get it to work now that you understand the problem. It is good practice anyway. :)
 
It is a multi user, but a user will only be able to change records linked to their own username - so in that respect it is kind of single user ...

Btw, is there a way to set all forms with the property no locks in one go?
 
I still would not run without any locks. The answer to your question is yes, but it takes code and I don't have time right now to write it, sorry. You would have to walk through the AllForms collection.
 

Users who are viewing this thread

Back
Top Bottom