A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

on hand quantity



 
 
Thread Tools Display Modes
  #1  
Old August 28th, 2006, 04:29 PM posted to microsoft.public.access.forms
segurarl
external usenet poster
 
Posts: 28
Default on hand quantity

To get the 'on hand' quantity I'm using a 'Dsum' [received]-[sold] from the
Detail table.

My products' form (from the Product table, not from the Detail table) has a
sub-form with the results from de 'Dsum'.

The problems is the form is "very slow" now.

Is there a better technique to show the 'on-hand' quantity on the form?

Thank you!
  #2  
Old August 28th, 2006, 04:56 PM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default on hand quantity

If this is a continuous form or datasheet (i.e. showing lots of products at
once) and you need it to be editable, it will be slow.

You can try writing your own DSum() replacement function based on a query
statement. It will probably be faster than DSum(), but will still be slow.

If you are using DSum() twice (once for the 'received' and once for the
'sold'), you could might double the speed by using a single call:
=DSum("[received]-[sold]", "Detail", "ProductID = " & Nz([ProductID],0))

If you don't mind a read-only result, using a subquery will be much more
efficient. Assuming a query based on the Product table only, type an
expression like this into a fresh column in the Field row in query design:
OnHand: (SELECT Sum([received]-[sold]) FROM Detail
WHERE Detail.ProductID = Product.ProductID)

If subqueries are new, see:
How to Create and Use Subqueries
at:
http://support.microsoft.com/?id=209066

--
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.

"segurarl" wrote in message
...
To get the 'on hand' quantity I'm using a 'Dsum' [received]-[sold] from
the
Detail table.

My products' form (from the Product table, not from the Detail table) has
a
sub-form with the results from de 'Dsum'.

The problems is the form is "very slow" now.

Is there a better technique to show the 'on-hand' quantity on the form?

Thank you!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.