Requery Issue in dynamic form display over network

  • Thread starter Thread starter p
  • Start date Start date
P

p

I have a form with a datasheet view used to input or edit records in an
SQL server table.

I have another form which continually displays information regarding
information in the SQL server table.

Think of this as a tool which is used in a conference call environment
- I have 3 people in different locations viewing the second form which
displays all of the contents of this table and is requeried every 5
seconds to synchronise changes made by different people. How I cant do
this for the first form because if i requery whilst someone is
editing/creating it cancels their inputs.

How can i synchronise both forms?
 
Why do you need to requery the first form?
If it is used for add or edit why not use a command button to update the
data when they have finished entry? I am assuming the 2nd form shows the same
table that is the record source for the first table.
Alternatively, use one form for entry and edit and have a listbox which
displays the contents of the table and using the timer event on the form just
requery the listbox. That way you can use the listbox as to provide the
variable to open and edit an entry.
Or is the problem that two people maybe editing the same record
simultaneously? Whose data will be the winner? In this case you would need to
lock the record being edited so only one could work on it at a time.

Regards,
Nick.
 
Basically the two forms show the same data - so with a requery being
successful in the second form - the two forms show different data.

Well if I use a button to update the first form as you suggested that
only works on the client who modified/added data - what about the other
users? This wouldnt work.

The two people editing the same record at the same time problem is not
an issue.

It would be good if i could compare the recordsets of the two forms in
data form only (theres only about 20 records displayed at any time)
then update if they are different
 
Does each use use a separate copy of the Fromt-End?

I am not sure if I understand your description correctly but it sound to me
that you need to use the Form_Timer event to requery the "View" Form at a
specfic interval.
 
Yes they have seperate front-ends.

I am requerying the "View" form at an interval - the problem is data
entered by a user is not seen in the "Edit/New" form by another user.
If I could just synchronise the View and Edit/New form everything would
be fine.

One solution would be to requery just like the "View" form but a
requery stops any changes being made to the form so is unacceptable.
 
My opinion is that you would be better off with just one form for add and
edit. Do away with your second form. On the edit form put a listbox with its
record source as the table and on the timer event put:
Me.listbox.requery
This would only requery the listbox and not the entire form, therefore
leaving the form in a dirty state.

Alternatively, you could set your first form to refresh on timer but put in
a proviso to cope with an edit in process. E.g.

If me.form.dirty = False then
RunCommand acCmdRefreshPage
End if

Regards,
Nick.
 
I've got it on a requery timer with a dirty detect. However this is
just a half-complete solution. I just cannot explain myself correctly

thanks for the help tho
 
For those of you who find this as a result of a search this is how i
solved the problem. Maybe some of you can even comment on how effective
it is.

I created a SQL Server based column in the table i'm working from of
Timestamp type. I then created the following view:

"SELECT CAST(CAST(@@DBTS AS VARBINARY) AS INT) AS TIMESTAMP"

This returns the last timestamp. I then compared this with a global
variable with the timestamp version MY form had through DLookup.


So it now only updates (requeries) when the timestamp is different.
 
Back
Top