[AccessD] Sensing Triggering Form Recordset Refreshing

Tortise@Paradise tortise at paradise.net.nz
Thu Sep 11 05:41:45 CDT 2003


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.




More information about the AccessD mailing list