Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Subform (Datasheet) Calculation (Syntax) Issues

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JK - 20 Dec 2007 15:57 GMT
I have a subform displayed in Datasheet view with the followign fields:
Product Number (cbo), Product Name (cbo), Quantity, Discount %, Unit Price,
SupplierID, and Product Number (Ref.)

I want the user to select an item using the pull-down menu, enter a quantity
and have the subform calculate the amount charged based on the discount
that's stored elseware, the unit price and the quantity.

This is the formula I have and it's not working for some reason:
=IIf(IsNull([Quantity]),0,(Sum(([Quantity]*[Unit
Price])-([Quantity]*[Discount]*100)/100*[Quantity])))

I'm getting an #ERROR in all fields...

I then must sum all of the values that come from the calculation above to
display on the main form. Totaling the "ExtendedPrice" is where this issue
began... For some reason I can't seem to make it work...

Any help would be greatly appreciated. If you more details are required, let
me know and I'll send them along... Thx so much!!
Minton M - 21 Dec 2007 00:27 GMT
> I have a subform displayed in Datasheet view with the followign fields:
> Product Number (cbo), Product Name (cbo), Quantity, Discount %, Unit Price,
[quoted text clipped - 16 lines]
> Any help would be greatly appreciated. If you more details are required, let
> me know and I'll send them along... Thx so much!!

A calculated form on a datasheet could do this for you, but I would
suspect a continuous form would give you more control since you're
doing lookups and calculations in other places. The #ERROR you're
seeing could be caused by having control names that have the same
names as fields (which is a perennial Access evil).

If you want to keep using the datasheet idea, make sure the field
names and control names are completely different. Then you could solve
the problem piece by piece - is a calculated field causing an error,
is a summation field causing an error, etc.

Hope this helps,
James
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.