UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V < 1 2  (Go to first unread post)
   Reply to this topicStart new topic
> Problemi With Decimal Numeber    
 
   
gemmathehusky
post Jul 2 2019, 09:20 AM
Post#21


UtterAccess VIP
Posts: 4,725
Joined: 5-June 07
From: UK


can you use a small subset of the list to test the recursion.
Put a break point here to check the values

I can't help thinking that it's an issue with the fractional parts of an item. Maybe you need to check for a dblqty of zero in the following code, and exit the loop, rather than do another iteration.


CODE
            If IsNumeric(rsParts!Qty) Then
                intMult = intMult * Nz(IIf(IsNumeric(rsParts!Qty), rsParts!Qty, 1), 1)
                dblQty = intMult
            Else
                dblQty = -9999
            End If

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
FCS001FCS
post Jul 2 2019, 02:02 PM
Post#22



Posts: 26
Joined: 11-March 12



OK Thanks.

Will try but may take a day or to to get back with results.
Go to the top of the page
 
gemmathehusky
post Jul 3 2019, 05:11 AM
Post#23


UtterAccess VIP
Posts: 4,725
Joined: 5-June 07
From: UK


Just another thought.

How many levels of recursion SHOULD you get?

I take it you are starting from an inventory list, some items of which are subassemblies, and therefore you have to break open the subassemblies to obtain the parts list, some of which are also subassemblies. So unless you have an erroneous linkage where a given subassembly includes a high level subassembly that will cause a circular reference, you must always get to a subassembly which is terminal - ie, has no more sub assemblies.

It may therefore be that the fractional quantities are a red herring - it was just that you and the OP both seemed to have problems with fractional parts.

Maybe you could check your parts database to make sure that there are no chain of sub-assemblies that reference a higher-level assembly.

Assuming there are no such problems, then if you are getting the wrong results, it's most likely going to relate to the condition that stops the recursion.

I can't easily follow the process by inspecting the code, so it would be useful to try it with real data. Could you upload a database/csv file with the data that is producing the problem?

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
FCS001FCS
post Jul 3 2019, 09:44 AM
Post#24



Posts: 26
Joined: 11-March 12



Thanks for the help. You gave me a lot to consider and investigate.

WRT Levels, I expect no more that 10.

I will try and get a smaller set of source tables that still display the error but I am short for time at the moment so it may take some time to get back to you.

Thanks again.
Go to the top of the page
 
2 Pages V < 1 2


Custom Search


RSSSearch   Top   Lo-Fi    22nd August 2019 - 06:36 PM