![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I have a form with a sub1 and a sub2. Most everything is working right. Except this. I have a "beforeupdate" and an "afterupdate" event on form sub2. "BeforeUpdate" works great. But, "AfterUpdate" never even executes? Here's my code... Private Sub Form_BeforeUpdate(Cancel As Integer) 'Check for "Yes" in any checkboxes If Me.CLVSend = -1 Or Me.KCYSend = -1 Or Me.MBOSend = -1 Or Me.NVLSend = -1 Or Me.STLSend = -1 Or Me.TNSend = -1 Or Me.CHQSend = -1 Then Me.SendCode = "S" Else Me.SendCode = "N" End If 'Add in keys, etc. Me.StatusWhenAdded = Me.CNT_STATUS Me.PICS_ID = [Forms]![frmlist_chooser]![subCompanies].[Form]! [PICS_ID] Me.FakeList_ID = Forms.frmlist_chooser.List_ID Me.qryList_Current_merge_COMP_CODE = Forms.frmlist_chooser.subCompanies.Form.COMP_CODE Me.ContactRecordId = Me.RecordID End Sub Private Sub Form_AfterUpdate() 'Update Companies list so count of "No. Picked" recalculates Forms!frmlist_chooser!subCompanies.Form.Requery End Sub Like I said, the problem is that the "AfterUpdate" even doesn't even trigger. Even if I wipe out the entire BeforeUpdate code, it still doesn't trigger AfterUpdate. Any ideas? Thanks, Jon |
#3
| |||
| |||
|
|
jonceramic wrote: Hi all, I have a form with a sub1 and a sub2. Most everything is working right. *Except this. I have a "beforeupdate" and an "afterupdate" event on form sub2. "BeforeUpdate" works great. *But, "AfterUpdate" never even executes? Here's my code... Private Sub Form_BeforeUpdate(Cancel As Integer) 'Check for "Yes" in any checkboxes * * If Me.CLVSend = -1 Or Me.KCYSend = -1 Or Me.MBOSend = -1 Or Me.NVLSend = -1 Or Me.STLSend = -1 Or Me.TNSend = -1 Or Me.CHQSend = -1 Then * * * * Me.SendCode = "S" * * Else * * * * Me.SendCode = "N" * * End If 'Add in keys, etc. * * Me.StatusWhenAdded = Me.CNT_STATUS * * Me.PICS_ID = [Forms]![frmlist_chooser]![subCompanies].[Form]! [PICS_ID] * * Me.FakeList_ID = Forms.frmlist_chooser.List_ID * * Me.qryList_Current_merge_COMP_CODE = Forms.frmlist_chooser.subCompanies.Form.COMP_CODE * * Me.ContactRecordId = Me.RecordID End Sub Private Sub Form_AfterUpdate() 'Update Companies list so count of "No. Picked" recalculates * * Forms!frmlist_chooser!subCompanies.Form.Requery End Sub Like I said, the problem is that the "AfterUpdate" even doesn't even trigger. *Even if I wipe out the entire BeforeUpdate code, it still doesn't trigger AfterUpdate. Any ideas? Thanks, Jon If a form isn't "dirty" it won't execute. *Put in a * * * * msgbox "In AfterUpdate" in your code and see if it executes when you add or modify a record.- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
On Oct 16, 10:24 am, Salad <o... (AT) vinegar (DOT) com> wrote: jonceramic wrote: Hi all, I have a form with a sub1 and a sub2. Most everything is working right. Except this. I have a "beforeupdate" and an "afterupdate" event on form sub2. "BeforeUpdate" works great. But, "AfterUpdate" never even executes? Here's my code... Private Sub Form_BeforeUpdate(Cancel As Integer) 'Check for "Yes" in any checkboxes If Me.CLVSend = -1 Or Me.KCYSend = -1 Or Me.MBOSend = -1 Or Me.NVLSend = -1 Or Me.STLSend = -1 Or Me.TNSend = -1 Or Me.CHQSend = -1 Then Me.SendCode = "S" Else Me.SendCode = "N" End If 'Add in keys, etc. Me.StatusWhenAdded = Me.CNT_STATUS Me.PICS_ID = [Forms]![frmlist_chooser]![subCompanies].[Form]! [PICS_ID] Me.FakeList_ID = Forms.frmlist_chooser.List_ID Me.qryList_Current_merge_COMP_CODE = Forms.frmlist_chooser.subCompanies.Form.COMP_CODE Me.ContactRecordId = Me.RecordID End Sub Private Sub Form_AfterUpdate() 'Update Companies list so count of "No. Picked" recalculates Forms!frmlist_chooser!subCompanies.Form.Requery End Sub Like I said, the problem is that the "AfterUpdate" even doesn't even trigger. Even if I wipe out the entire BeforeUpdate code, it still doesn't trigger AfterUpdate. Any ideas? Thanks, Jon If a form isn't "dirty" it won't execute. Put in a msgbox "In AfterUpdate" in your code and see if it executes when you add or modify a record.- Hide quoted text - - Show quoted text - Thx Salad. I'd tried that, had the msgbox in, had the "brown dot of shame" clicked on too. As if having both would help. Nothing. Then, I remembered the bug(?) where you can have VBA code, but the control properties window does not say "[Event Procedure]" in it. So, I clicked the "..." to make it realize the code was there, and everything's fine again. Drat. I feel so dumb. *shakes fist with futility at the sky at whichever Microsoft code lackey hasn't fixed this* I've had that happen as well. Glad you gound the solution. |
|
Jon |
![]() |
| Thread Tools | |
| Display Modes | |
| |