Afterupdate Problems

I type in a field
Is that control you're typing in bound to a field in your table? If not, then the on_dirty event won't fire.

If you can upload a copy of your db in AC 2000 version I can take a look. But honestly, you're better off with Bob. What he's forgotten about Access is more than I will probably ever know ;)
 
Look, here's a quick example db that shows how I did it. I also use the on_current event to reset the checkbox automatically after you change records.
 

Attachments

Last edited:
Ok. This is ridiculous. It works exactly as needed. I made a new db with 1 form and 1 table with the same thing and it worked. Now, why doesn't my real form work? Is it corruption? Is there a possibility for a weird setting that I am unaware of? I am going mildly insane here.
 
Is it corruption?

Quite possible. Also could be that you have an unrecognized error in your form's vba code module that is stopping all vba in its tracks. Try compiling your db (open vba editor>DebugMenu>Compile...)

Fix any and all errors that may be found until the compile runs without finding any errors. Then try again. If that doesn't turn up anything, it is likely corruption as Bob originally said.

If that's the case then follow Bob's original instructions. If that still doesn't work, then delete the form and start over with a new one or import it from an old backup of your db (prior to any signs of corruption).
 
Sorry. Here is another db that is compiled with no errors. The main form opens. There is a square with 3 dots next to 'Contact'. Click that. This opens the problem form. You will see a checkbox with the label of Check104. Type something on the form and notice that the checkbox does not get updated. Look at the code and you will see that i have an on_update event that should just make that checkbox true. I hope this is more clear for those kind enough to have a look at my db.

Thank you again for hanging in there with me.
 

Attachments

As I said before, I am using Access 2000. It cannot open files from later versions unless you save them in Access 2000 format.
 
The form is obviously corrupt as I just created another form from qryContactsForm and put a message box in the DIRTY event and it fired just fine when I modified any control.

I think you may need to recreate it from scratch. I tried exporting it to another database and then importing it back and that didn't work.
 
I think you need to observe a minute's silence for your form.

...


...


Too soon, Alas.
RIP form. RIP.
 
Sorry about the 2000 format thing. Must have missed that. I will redo the form. So sad. I wonder how far I can get with copy and paste. Thanks guys. I will let you know if it works.
 
Solution

For those who are interested-

The main problem stems from the on_current event of a form. It is not a specific problem but so far it appears to be related to Function Calls. It is not all function calls, and I haven't found a unique element yet, but certain function calls cause the on_dirty event to not execute. The most recent I found was 'Call Contact_Combo_update ()' I comment this one line out and the on_dirty event works just fine. This has only happened to 2 forms out of 8 so far so it is not terribly widespread and it may be my db specific, but hopefully someone will find this helpful in the future.

EDIT: Me.WasUpdated = True makes the on_dirty event conk out. Why???????????????? (it is a checkbox)

Thanks to CraigDolphin and boblarsen for their help in tracking this down.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom