Calling public sub and updating all fields

kmanji

Registered User.
Local time
Today, 22:53
Joined
Nov 13, 2016
Messages
15
Hi.

I have a navigation form that has tabbed subforms. Each subform deals with a differently calculated product and quantity, but similar calculated price formula. I cannot use a unbound field for the price, as I need the same price to show up years later, rather a newly calculated price when accessed again. Hence the price is calculated from an after_update event of a selection combobox in the each of the tabbed subforms.

I also have a checkbox in the main navigationsubform asking whether the quotation is VAT Exempt, or VAT applicable, I would want all prices recalculated in each of the tabbed subforms based on that selection.

I created a public sub calling one of the tabbed subform's combobox's afterupdate, and it works, but changes only the price of the first row. So, for example, in one of the tabbed subforms I have four lines of items, and the prices are $20 $30 $40 $50. When VAT is activated, I call the tabbed subform's public sub Update_Price, the price updates to $24 $30 $40 $50. So, it just changes the first line, not subsequent lines.

How do i manage to change throughout the table? Thanks in advance.
 
Last edited:
There is no 'first' row.
You need some criteria to determine what is the first. Is it sorted?
If the list is sorted by a datestamp, or an index (autoNum) THEN you can update using something like this...
VID = max(ID)
Update table set field = 99 where [coNum=forms!frm!txtCoNum and [id]=" & vID
 
If the combo boxes are on continuous forms calling the afterupdate code of one of them isn't going to execute for all of them. You need to write the subroutine so that it updates the table and then requery the subform.
 

Users who are viewing this thread

Back
Top Bottom