Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfterUpdate change 2 form values

Status
Not open for further replies.

wrmedia

Technical User
Jun 6, 2002
19
US
Ok let me see if I can explain all these right

ISSUE 1

when users choose a value for Combo25 I would like it to change 2 values on the form - got the first one working with the code below but what code do I add to change a second value? Can I just add another AfterUpdate Sub?

Private Sub Combo25_AfterUpdate()
Forms!Grat_Journal!Grat_Transaction.Form!T_Fee = Combo25.Column(4)
End Sub

ISSUE 2

when users add a value in number of copies produced for a client on this form I have it related to a query that contains client name and price of copies for that client

I would like it to take the value in number of copies for this client and multiply it by price of copies for this client and place the resulting total in total for copies field

make sense?

ISSUE 3

when a user changes the status of an order to "C" it calculates all items to form a grand total

I would like a field to keep a running total of all grand totals that are "C" in the header of the form - this is a form in multi-record view

to add an extra level of complexity some of the grand totals already have an amount in them when the item is "O" for open - I would like it to ignore these amounts


Thanking you in advance for any input



 
Issue 1
NO There can only be one After_Update for a particular control, but you can have as many lines of code in that one proc as you like. So just put the second value change after the first one, before the EndSub.


Issue 2
Yes, Makes Sense

In the txtTotalForCopies control's ControlSource put:-
= txtNumberOfCopies * txtPriceOfCopies

However the term "I have it related to" is not one that I recognise or understand.

There may be more to come on this issue.

Issue 3
The easiest way to do this is to create a recordset of the fields that you need to calculate the totals and use the WHERE OrderStatus = "C" clause
Then cycle through the recordset calculating the totals and summing to a GrandTotalVariable.
Then close recordset and set the control in the header as:=
ControlName = GrandTotalVariable.

If you need more help on this bit I'll need to know what if you're running DAO or ADO ( up to A97 or A2000 + )


'ope-that-'elps.

G LS

make sense

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top