Question : Access 2007 - AfterUpdate not working

Okay, I have to be over looking something simple.

I have a Master form with a sub form and everything is working, except a combo box with an Event Procedure set to take the value of the combo box and move the recordset to the appropriate record.

Private Sub SiteLookup_AfterUpdate()
'Move to the record selected in the control
'Note: Site_Code links the Master and Child forms, SiteLookUp is the name of the combo box.

    Me.RecordsetClone.FindFirst "[Site_Code] = " & Me![SiteLookup]      
    Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub

When I use the search option on the Master form it works, just not the Event Procedure on the combo box.

Answer : Access 2007 - AfterUpdate not working

V 2003
See if the database you uploaded works for you. If it does, the event was probably attached to the code when you created the mdb or the form in the 2007 version is corrupted.

To make sure the event is connected to the code, do this (as I explained before):  Does the after update event in the properties window while the combobox is selected show [Event Procedure]?  When you click on the button with three dots to the right of the [Event Procedure], does the visual basic editor open with the cursor on the Private Sub SiteLookup_AfterUpdate() procedure?

To correct a corrupted database or form:  Going past step 7 will probably not help for this problem. I include the additional steps for your future reference.

Steps (approximately in order) to use to fix a corrupted Access database. (Test after each step.)

1) CREATE A BACKUP OF THE CORRUPT DATABASE. (Just in case)

2) Compact and repair

3) Use jetcomp.exe  http://support.microsoft.com/default.aspx?scid=kb;en-us;Q273956

4) decompile: in run: msaccess "dbPathName.mdb" /decompile
   Compact/repair:  in run: msaccess "dbPathName.mdb" /compact
   compile: in VB editor: debug> compile
   Compact/repair
   http://www.granite.ab.ca/access/decompile.htm

5) Use a backup (you have a lot of those -- yes?)

6) If you can identify one or a few forms or reports causing problems, copy the problem form/report from a backup.  Or create a new form/report and copy all the objects in the old form/report to the new one. Copy the code from the old form/report using the undocumented
    Application.SaveAsText acForm, FormName, "C:\" & FormName & ".txt"
then paste that from Notepad into the new form/report.  If a module, copy the code using SaveAsText, create a new module, paste the code into the new module.


7) Create a new database, use File> Get external data> Import to get all objects of the damaged database and set up the options again.

8) Try a recovery tool:
   www.officerecovery.com/access/index.htm
   www.mvps.org/access/tables/tbl0018.htm

9) Hire a company to repair the database  http://www.pksolutions.com/services.htm

Additional information:
How to Troubleshoot/Repair Damaged Jet 3.0 and Prior Databases
http://support.microsoft.com/support/kb/articles/Q109/9/53.asp

How to Troubleshoot Corruption in a Microsoft Access Database
http://support.microsoft.com/default.aspx?scid=kb;en-us;306204

Corrupt Microsoft Access MDBs FAQ
http://www.granite.ab.ca/access/corruptmdbs.htm
 
 
Random Solutions  
 
programming4us programming4us