dbTalk Databases Forums  

After update code in a subform never executes?

comp.databases.ms-access comp.databases.ms-access


Discuss After update code in a subform never executes? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jonceramic
 
Posts: n/a

Default After update code in a subform never executes? - 10-16-2008 , 10:07 AM






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

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: After update code in a subform never executes? - 10-16-2008 , 10:24 AM






jonceramic wrote:

Quote:
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.


Reply With Quote
  #3  
Old   
jonceramic
 
Posts: n/a

Default Re: After update code in a subform never executes? - 10-16-2008 , 10:31 AM



On Oct 16, 10:24*am, Salad <o... (AT) vinegar (DOT) com> wrote:
Quote:
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*

Jon


Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: After update code in a subform never executes? - 10-16-2008 , 10:33 AM



jonceramic wrote:

Quote:
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.

Quote:
Jon

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.