Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

AfterUpdate event not firing?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ionic-fire - 19 Nov 2007 17:21 GMT
I have a form which opens up a subform. On subform, there is a tab control
which has five tabs on it. Each tab contains a sub-form on it. I have a combo
box on one of these sub-forms to which I am attempting to add in
functionality to implement a recent entries list. I have the following code
added to this sub-form's control's AfterUpdate event. However, this event
does not fire after the field is updated. I have verified this by inserting
breakpoints in the code, and the breakpoint never fires either.

Any idea why the AfterUpdate event is not firing? Any input would be great.
Thanks!

'************************************************************
Private Sub cmbParameterName_AfterUpdate()
'add new entries to recent parameters lookup list.

On Error GoTo ErrorHandler

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim boolFound As Boolean
Dim foo As String

   Set db = CurrentDb
   Set rs = db.OpenRecordset("tblRecentParameters", dbOpenDynaset)
   boolFound = False   'set initial found status to false!
             
   While Not rs.EOF
           foo = rs.Fields("RecentParameter") 'store current recordset's
value
           If foo = cmbRecentParameter Then
               boolFound = True    'value found in table
           End If
       foo = ""    'reset string
       rs.MoveNext 'move to next record
   
   Wend
   
   On Error Resume Next    'ignore errors
   If boolFound = False Then   'value not found. add to table
       rs.AddNew   'add new record to table
           rs.Fields("RecentParameter") = cmbRecentParameter
       rs.Update
   End If
       rs.Close

Set rs = Nothing
Set db = Nothing

Exit_ErrorHandler:
   Exit Sub

ErrorHandler:
   MsgBox Err.Description
   Resume Exit_ErrorHandler
ionic-fire - 19 Nov 2007 17:26 GMT
Well, now it started working! Strange.....

>I have a form which opens up a subform. On subform, there is a tab control
>which has five tabs on it. Each tab contains a sub-form on it. I have a combo
[quoted text clipped - 50 lines]
>    MsgBox Err.Description
>    Resume Exit_ErrorHandler
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.