[AccessD] Sensing Triggering Form Recordset Refreshing

Tortise@Paradise tortise at paradise.net.nz
Fri Sep 12 14:49:22 CDT 2003


For the record if anyone becomes interested I solved this by inserting me.form.requery in the dropdown box routine.  I was concerned
requerying the form's data with every search would degrade performance.  In reality it didn't seem to matter, so testing for new
records seems pointless.
So code appears:

Private Sub cboCompany_AfterUpdate()
On Error GoTo cboCompany_AfterUpdate_Err
   ' Update form data in case new records added by other users..
     Me.form.requery
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[Counter] = " & Me![cboCompany]
    Me.Bookmark = Me.RecordsetClone.Bookmark
etc...

Kind regards,
David Hingston
_________________________________________________________________________
Engines2Go - Now THAT's a Search Engine!
Automated major search engine manager
Makes searching quicker and easier - Have you tried it?
http://www.engines2go.com/
http://www.cheqsoft.com/  The home of Clipboard Express, MP3 Detective, TimesOwn and Break Reminder.
----- Original Message -----
From: "Tortise at Paradise" <tortise at paradise.net.nz>
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Sent: Thursday, September 11, 2003 10:41 PM
Subject: [AccessD] Sensing Triggering Form Recordset Refreshing


Hi
I have a form with multiple users using.  When a new record is added by one user the other users dropdown boxes show the new records
(once saved) but navigating to these new records fails, code below, finding the first record.  Closing and reopening the form fixes
the problem but this is labour intensive.
Can someone tell me how to sense when a new record has been added elsewhere and to somehow to tell the form to somehow refresh when
required?

Navigation code from one dropdown box:

Private Sub cboCompany_AfterUpdate()
On Error GoTo cboCompany_AfterUpdate_Err
    ' Find the record that matches the control.

' >>> Need to add in some code here (I think) to sense that there are new records present and refresh the form records before
navigating
' IF what?
'then
'Refresh something somehow...
'end if

    Me.RecordsetClone.FindFirst "[Counter] = " & Me![cboCompany]
    Me.Bookmark = Me.RecordsetClone.Bookmark


   'Record each search
Dim dbs As Database, rst As Recordset

    ' Return Database variable pointing to current database.
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("tblSearch")
    With rst
        ' Add new record to end of Recordset object.
        .AddNew
        !ContactsCounterNumber = Me![txtCounter]        ' Add data.
    .Update                     ' Save changes.
    End With

    DoCmd.GoToControl "txtCompany"

cboCompany_AfterUpdate_Exit:
    Exit Sub

cboCompany_AfterUpdate_Err:
    MsgBox Error$
    Resume cboCompany_AfterUpdate_Exit

End Sub

TIA
Kind regards,
David Hingston
_________________________________________________________________________
Engines2Go - Now THAT's a Search Engine!
Automated major search engine manager
Makes searching quicker and easier - Have you tried it?
http://www.engines2go.com/
http://www.cheqsoft.com/  The home of Clipboard Express, MP3 Detective, TimesOwn and Break Reminder.


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list