record locks

C

chriske911

what could be the reason that conflicts happen when changing record
values?

the strange thing that, for this app, the user who gets the pop up that
"this record is in use by another user" is sure that no one else is
editing that record at the same time

I do use a pop up form to edit details in the record that is being
shown in a main form

thnx
 
A

Arvin Meyer [MVP]

chriske911 said:
what could be the reason that conflicts happen when changing record
values?

the strange thing that, for this app, the user who gets the pop up that
"this record is in use by another user" is sure that no one else is
editing that record at the same time

I do use a pop up form to edit details in the record that is being
shown in a main form

You've locked the record by allowing editing on the first form, while also
editing in the second.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
C

chriske911

chriske911 said:
You've locked the record by allowing editing on the first form, while also
editing in the second.

that's what I thought
how to circumvent this?

cause I think it is a bit more user friendly to allw them to apply
changes for the fields that are visible in the main form, no?

grtz
 
A

Arvin Meyer [MVP]

that's what I thought
how to circumvent this?

Either forget the popup and do the editing on the first form, or lock the
first form and allow editing only on the second form. In the rare instance
that I do the second choice, I usually lock the first form, by making it
unbound and filling the form with a recordset which can't be edited (ie a
copy of the records)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
T

TedMi

Another option: If you don't want the main form to be open for editing by
default, but have the user perform some action to enter update mode (a very
common approach in UI design), do this:
Bind the form's controls to your record
Set the form's Allow Updates property to False.
Put a button on the form that says "Make changes to this record"
The click event of the button should set AllowUpdates to True.
The Current event of the form (which fires when the current record changes,
which also writes the changes) should set the Allow Updates back to False.
 
C

chriske911

Another option: If you don't want the main form to be open for editing by
default, but have the user perform some action to enter update mode (a very
common approach in UI design), do this:
Bind the form's controls to your record
Set the form's Allow Updates property to False.
Put a button on the form that says "Make changes to this record"
The click event of the button should set AllowUpdates to True.
The Current event of the form (which fires when the current record changes,
which also writes the changes) should set the Allow Updates back to False.

which form are you talking about here?
cause the idea is to have common fields on the main input form
and specific fields that are not so commonly used in the pop up form
this to avoid overwhelming on the main form

so I can't have a button on the main form to allow updates since those
specific fields are only available on the pop up form

grtz
 
A

Arvin Meyer [MVP]

Perhaps it might be a better idea to use a second one-to-one table for the
fields which are only used in the second table. Normally, this is not a good
idea, but it seems as though your design may require it.

If that's the direction you decide to go, you can easily make the second
table by copying the first one. Then changing the autonumber key field to a
long integer, and deleting unnecessary fields in the second table. In the
relationships window, link the 2 tables together. In your popup form, set
the default value of the PrimaryKey to read the Key on the first form.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
C

chriske911

Perhaps it might be a better idea to use a second one-to-one table for the
fields which are only used in the second table. Normally, this is not a good
idea, but it seems as though your design may require it.

If that's the direction you decide to go, you can easily make the second
table by copying the first one. Then changing the autonumber key field to a
long integer, and deleting unnecessary fields in the second table. In the
relationships window, link the 2 tables together. In your popup form, set
the default value of the PrimaryKey to read the Key on the first form.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

indeed, a setup one would never choose but...
I'm afraid this is not possible either,
since there are some fields shown in both forms

a user would be able to change fields in the pop up form but not see
the details for that record which are shown in the main form, doesn't
sound logical to me or user friendly

I do understand that it would solve my problems but it would be the
last thing to apply for me

grtz
 
Top