I have a multi-user database in Acc2003. Parent+child forms link directly to
tables for data entry/editing.
When user 1 enters new records into the form (e.g. into the parent form),
other users do not see the record, even if they scroll or search. They have
to close and open the form to see it. Refresh does not do the trick.
I inserted a timer event to requery the data source. This works, but with
tragic circumstances:
The requeried dataset brings everybody back to the top parent record,
regardless of where they are or what they are doing. People wind up editing
the wrong record, too!
Is there a "nicer" way to requery the data in such a way that users are
returned to their current record and current field?
Thanks!
George
>When user 1 enters new records into the form (e.g. into the parent form),
>other users do not see the record, even if they scroll or search. They have
>to close and open the form to see it. Refresh does not do the trick.
I always add a button which executes me.requery.
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
GeorgeAtkins - 05 Mar 2005 22:55 GMT
Thanks for the reply Tony! As I wrote further on in my message, I did use the
requery method, though linked to a timer. I also started with a button, but
the users don't like to remember to click it.
In any event, the problem with requery is that the user is sent packing to
the first record in the table, no matter what record they are on or field
they are in.
I believe a bookmark using a recordsetclone can at least get me back to the
current record, but not the field. This database is something I inherited
support for, and the datasource for the form(s) is the actual Access tables.
George
> >When user 1 enters new records into the form (e.g. into the parent form),
> >other users do not see the record, even if they scroll or search. They have
[quoted text clipped - 9 lines]
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
GeorgeAtkins - 06 Mar 2005 05:13 GMT
Hey!
I've worked out a solution that appears to work for me (minus the error
trapping), even if the cursor is in a child form (or a grand-child form):
Private Sub Form_Timer()
Dim RecId As Long
Dim MyCtr As Control
Set MyCtr = Me.ActiveControl
RecId = Me.[ID Number]
Me.Requery
With Me.RecordsetClone
.FindFirst "[ID Number] =" & RecId
Me.Bookmark = .Bookmark
End With
' Now return to the field I was in before requery...
MyCtr.SetFocus
Screen.ActiveControl.SelStart = CInt(Len(Screen.ActiveControl))
End Sub
And I've also found that the following seems to work as a substitute for
requery:
Me.RecordSource = ""
Me.RecordSource = "Family Resources Client Data"
Is there any reason to use one instead of the other?
Thanks.
George
> >When user 1 enters new records into the form (e.g. into the parent form),
> >other users do not see the record, even if they scroll or search. They have
[quoted text clipped - 9 lines]
> Microsoft Access Links, Hints, Tips & Accounting Systems at
> http://www.granite.ab.ca/accsmstr.htm
Place a "save" button on the form to trigger a requery when they're
finishing entering data, then use "currentrecord"
Dim intcurrentrecord As Integer
'Requery form, which causes the record to lock
intcurrentrecord = Me.currentrecord
Me.Requery
DoCmd.GoToRecord acDataForm, "frmMain", acGoTo, intcurrentrecord
'unlock record
Me.AllowEdits = True