Unbound form and controls updating anyway

  • Thread starter rdemyan via AccessMonster.com
  • Start date
R

rdemyan via AccessMonster.com

I have an unbound form with an unbound listbox. The form is being used to
update a table. Since it is unbound, I have to code for "write-after-write"
conflicts. I define this as:

1) User 1 selects a record from the listbox to edit. My code puts the
updatable fields into textboxes when the user doubleclicks on the listbox row.
The values in the textboxes can then be edited and saved to the table.

2) User 2 is viewing the same record on the form.

3) User 1 makes a change and saves it.

4) The data on User 2's machine should not have updated and if User 2 double-
clicks on the same record in the listbox to edit it, he/she should not see
the change.

This is the way things work when textboxes are used and not listboxes. As an
aside, I use the method recommended by Mary Chipman, et.al. in their SQL
Server book to update tables using unbound forms. This involves checking the
Concurrency ID which is added to the table.

Here's the issue. I'm noticing that when User 1 changes the listbox record,
that when User 2 just clicks on the listbox (say to scroll through it), the
record on User 2's machine (that was just updated by User 1) is in fact
updated on User 2's machine????

But this is an unbound form, so how can that be. I have noticed that when
the RowSource of a combobox or listbox is set in code, the RowSource listed
in "Properties" does retain whatever was specified in VBA code.

So does this then effectively turn the listbox/combobox into bound controls?

Also, is there anyway that I can code to trap this change made by User #1,
which somehow magically shows up on User#2's machine, even though the form is
UNBOUND, so that I can inform User#2 that a change has been made.

Thanks.
 
H

HKComputer

Your problem is a strange one since most programmers are battling the
opposite, needing the control to requery to stay up to date.

Check to make sure that there is not any other code that executes a requery.
Maybe in the click event on the listbox. I don't think that your list box is
bound just because it has an SQL statement in its recordsource. My listboxes
all require code to be updated after adding, deleting or editing records and
they too are using an SQL statement.
 
H

HKComputer

I just had another idea. I don't see how you could trap that event but you
could add a field to your tabled called Updated and when the user saves
changes it could fill in a default value of Now() in General Date format so
that users can see when it was last updated. You could also change the text
color if the time recorded in that field was within the last few moments,
minutes, hours, etc.
 

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