By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,162 Members | 999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,162 IT Pros & Developers. It's quick & easy.

after update handling

P: n/a
I want to put one and same function under 2 controls in my subform.
The controls are
called quantity and cartons. Is it posible to build a code that
recognizes the after update event of the controls quantity and
cartons. In other words, my code must
recognize the after update events of the control and the
cartons.Something of the following order

If Me![MySubform].[Form].[Quantity].AfterUpdfate = True Then
Do Something
Else If Me![MySubform].[Form].[cartons].AfterUpdate = True Then
Do something
End If
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can write the procedure in one event, and call it from the other, e.g.:

Private Sub Quantity_AfterUpdate()
Do Something
End Sub

Private Sub Cartons_AfterUpdate()
Call Quantity_AfterUpdate
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Johm" <ke**@abv.bg> wrote in message
news:24**************************@posting.google.c om...
I want to put one and same function under 2 controls in my subform.
The controls are
called quantity and cartons. Is it posible to build a code that
recognizes the after update event of the controls quantity and
cartons. In other words, my code must
recognize the after update events of the control and the
cartons.Something of the following order

If Me![MySubform].[Form].[Quantity].AfterUpdfate = True Then
Do Something
Else If Me![MySubform].[Form].[cartons].AfterUpdate = True Then
Do something
End If

Nov 12 '05 #2

P: n/a
On Sun, 15 Feb 2004 19:57:33 +0800, Allen Browne wrote:
You can write the procedure in one event, and call it from the other, e.g.:

Private Sub Quantity_AfterUpdate()
Do Something
End Sub

Private Sub Cartons_AfterUpdate()
Call Quantity_AfterUpdate
End Sub


Alternatively, create a private Sub or function within the form like...
ControlUpdate(cntrl as Control) As Boolean (or otherwise)

Each control that calls this must simply pass it's refference as the
argument (Me!ControlName). This is sometimes better when the validations on
the control are the same, but actions taken might be different - less Cases
/ Ifs to deal with.
--
Mike Storr
veraccess.com
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.