473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Inconsistent delay of total from Continuous subform to main form

Dear all,

I have a scenario that is driving me nuts. (MS Access 2003)

I have a form/subform (Continuous form) where it gets its data from tables Order and Order_Details.

In the footer section of the subform I have a hidden textbox named txtOrder_Total_Amount which displays the total of the whole order. On the main form I have a bound contol from the Order table, namely Order.Order_Total_Amount_Euro

On the subform I have fields such as Product, Quantity, Unit_Price, Discount, Value_In_USD, Value_In_EUR. (certain Orders_Details are in USD whilst others are in EUR, but since I only care about EUR I calculate the exchange rate for all Order_Details that are listed in USD)

If the user changes the Product, Quantity or the Discount then the rest are modified on the exit event of each field. I then call the sub 'Update_Totals' which simply will refresh the txtOrder_Total_Amount (found in the footer of the subform ) based on the Order_Details.Value_In_EUR field

here is the code

Private Sub cmdUpdateTotals()

' Refresh the Order_Total_Amount

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Immediately after this code, I have the following code (to populate the main form Order_Total_Amount_Euro field.

Forms!Order.Order_Total_Amount_Euro = Forms!Order.OrderDetail!Order_Total_Amount

End sub

I have made both the Order.Order_Total_Amount_Euro and the Order.Order_Details.txtOrder_Total_Amount visible so I can view the results.

The problem is that although the code executes with no syntax errors (and I dont see any logic error here) and although the txtOrder_Total_Amount is correctly updated, the main form Order.Order_Total_Amount_Euro updates sometimes with a delay and sometimes not at all.

Example.
Order_Detail 1. Quantity = 100, Product_Price = 10 EUR, Discount = 50EUR, Value_In_Eur = 950.

Order_Detail 2. Quantity = 200, Product_Price = 10 EUR, Discount = 150EUR, Value_In_Eur = 1850.

txtOrder_Total_Value (in footer of subform) = 2800
Mainform.Order_Total_Value_Euro = 2800

If I change the quantity of the first Order_Detail record from 100 to 110 (and subsequantly the Value_In_Eur = 1050) then

txtOrder_Total_Value (in footer of subform) = 2900
Mainform.Order_Total_Value_Euru = 2800.

It may update to 2900 after a certain delay or may not at all.

Now if I repeatedly clickand tab away on the Quantity field at some inconsisent point the Mainform.Order_Total_Value_Euru will eventually update.

Any ideas ?
Kind Regards

VirtualGreek
May 16 '07 #1
3 2390
puppydogbuddy
1,923 Expert 1GB
Try changing this:
Forms!Order.Order_Total_Amount_Euro = Forms!Order.OrderDetail!Order_Total_Amount

To:
Forms!Order.Order_Total_Amount_Euro.Value = Forms!Order.OrderDetail!Order_Total_Amount


In the subform, put the following code in the OnChange event for the textbox that has computation of the detail total so that the mainformTotal will be recalculated.
Forms!Order.Order_Total_Amount_Euro.Recalc
May 16 '07 #2
Try changing this:
Forms!Order.Order_Total_Amount_Euro = Forms!Order.OrderDetail!Order_Total_Amount

To:
Forms!Order.Order_Total_Amount_Euro.Value = Forms!Order.OrderDetail!Order_Total_Amount


In the subform, put the following code in the OnChange event for the textbox that has computation of the detail total so that the mainformTotal will be recalculated.
Forms!Order.Order_Total_Amount_Euro.Recalc

Thanks puppydogbuddy. You pointed me to the right direction.

Take care!
VG
May 17 '07 #3
puppydogbuddy
1,923 Expert 1GB
[color=black][size=3][font=Times New Roman]VG,[/font][/size][/color]

[color=black][size=3][font=Times New Roman]Forgot to tell you that you should replace this code line: [/font][/size][/color][size=3][font=Times New Roman]DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70[color=black][/color][/font][/size]

[color=black][size=3][font=Times New Roman][/font][/size][/color]
[color=black][size=3][font=Times New Roman]With either this line:[/font][/size][/color]
[color=black][size=3][font=Times New Roman]DoCmd.RunCommand acCmdSaveRecord[/font][/size][/color]

[color=black][size=3][font=Times New Roman]Or this line:[/font][/size][/color]

[color=black][size=3][font=Times New Roman] Me.Dirty = False[/font][/size][/color]

[color=black][size=3][font=Times New Roman] [/font][/size][/color]

[color=black][size=3][font=Times New Roman]The DoMenuItem syntax is not used in access versions 2000 and higher. Please confirm that you got this message.[/font][/size][/color]

[color=black][size=3][font=Times New Roman] [/font][/size][/color]

[color=black][font=Times New Roman][size=3]Thanks. [/size][/font][/color]
May 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ellen Manning | last post by:
I've got an A2K form with a subform based on a query. This query has a checkbox and an amount field and returns records if checkbox is checked. I Dsum the amount field and display on the main...
2
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS...
2
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two...
0
by: Galina | last post by:
Hello I have an application in MS Access 2K. A form contains 2 subforms. Each subform is based on it's own table. One table contains a field Total. Another one contains a field Points. The field...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
1
by: kaeldowdy | last post by:
This one is stumping me! I have a Form/Subform arrangement. The main form is set as a Single Form and the sub form is set as Continuous Forms. On the Form_AfterUpdate event of the subform, I...
5
by: ApexData | last post by:
I have a Continuous SubForm on a TabPage. Above the ContinuousForm is a "box of fields" I use to display the entire record that the focus is on. When one points to a record using the...
3
by: Steve | last post by:
Is there a way to put a main form/subform in a continuous form so I can scroll through all the records in the main form? Thanks!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.