Update linked field immediately from form

  • Thread starter Thread starter gg
  • Start date Start date
G

gg

This is probably simple, but I can't seem to get around it. I have a form
that is sourced to a query. The query main source is a linked to table in
another db file that sources a similar form in that file.

When I make a change on a form in either file, I would like it to show on
the form in the linked file immediately. The only way that I can seem to do
that is to close the form that I just updated, then go to the other file and
open the desired form . What code (onUpdate?) or whatever else do I have to
do to make the change show up immediately in the linked file's form without
closing and opening? I am using Ac2000 with W2000. Thanks in advance for
any help.
 
gg said:
This is probably simple, but I can't seem to get around it. I have a form
that is sourced to a query. The query main source is a linked to table in
another db file that sources a similar form in that file.

When I make a change on a form in either file, I would like it to show on
the form in the linked file immediately. The only way that I can seem to
do
that is to close the form that I just updated, then go to the other file
and
open the desired form . What code (onUpdate?) or whatever else do I have
to
do to make the change show up immediately in the linked file's form
without
closing and opening? I am using Ac2000 with W2000. Thanks in advance for
any help.
 
Hi,

So, do I understand that you have both databases open at the same time?
And want changes made to the second database, while you are in the first
database, to then show up in the second database? If that is the case, you
may want to set up a timer on the form in the second database's form. Maybe
set to requery every minute or so. In the On Timer event you could then do a
Requery. Note that this can be somewhat problematic as you will want to test
to see if the current record being displayed is being edited. In which case
you should not do the requery. Very annoying to the user. After the requery
you may also want to make sure you are repositioned onto the same record as
before the requery. As an alternative, you could just add a "Requery" button
to the form that the user can click whenever the user desires to see changes
made elsewhere. Requery is useful when new records may be added. If the
only changes that are being made through the first database are updates, you
could do a Refresh instead. That will refresh the data in the current set of
records being displayed. Note that Access does an automatic refresh
periodically anyway.

Hope that helps,

Clifford Bass
 
Thank you for the quick replay and for covering the various possibilities. I
opted for the refresh button-works great.
 
Hi Denise,

Refresh All only updates the contents of the existing set of rows. So
if you open up a form and it displays say ten records, the refresh will
update only those ten records with changes made by other users. Deleted rows
will now show with #Deleted in the fields. New rows added by other users
will not show. It also does not reposition your location in the recordset.
So if you are on record three, you stay on record three.

Requery goes out and re-executes the original query used to get the set
of rows. New rows will now be included. Deleted rows will be removed.
Updated rows will of course show their updates. And finally, it repositions
you to the beginning of the set of records.

Clifford Bass
 
Back
Top