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 Programming / May 2007

Tip: Looking for answers? Try searching our database.

How to get price in two ways?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Anders - 29 May 2007 17:34 GMT
Hi all!
I am building a subform for order details and pricing with Acces 2003. There
are unit prices and prices based on square meter in the product table. How
can I get the price both ways into the price field in the subform? The square
meter calculation works very well. Either one of them retrieves the price,
but no both simultaneously.
Signature

Have a Nice Day!

Carl Rapson - 29 May 2007 20:31 GMT
> Hi all!
> I am building a subform for order details and pricing with Acces 2003.
[quoted text clipped - 4 lines]
> meter calculation works very well. Either one of them retrieves the price,
> but no both simultaneously.

It's not clear what you're asking for. Are you wanting to display both
prices in a single field or as separate fields? In either case, you'll need
to set up a query that contains the calculations you need, and base the
subform on that query instead of on the product table directly. Queries can
contain calculated fields, and the subform doesn't know where the fields
come from.

Carl Rapson
Mark Anders - 30 May 2007 10:04 GMT
Hi Carl!
Thank you for reply. The idea is to get the unit price directly from the
product table and m2-based price with calculation after entering dimensions
(W * H, there are fields for both dimensions) to the same UnitPrice-field in
the subform. I have tried a calculation field in the query like
IIf(m2>0,1;m2*UnitPrice;UnitPrice) but  no result.
Signature

Have a Nice Day!

"Carl Rapson" kirjoitti:

> > Hi all!
> > I am building a subform for order details and pricing with Acces 2003.
[quoted text clipped - 13 lines]
>
> Carl Rapson
Mark Anders - 30 May 2007 15:22 GMT
I did it!
Many days I hit my head at wall, but now it works. Still is one problem, I
should a few cases write price at the same field but writing into it is not
possible. How this problem could be solved?
Signature

Have a Nice Day!

"Mark Anders" kirjoitti:

> Hi all!
> I am building a subform for order details and pricing with Acces 2003. There
> are unit prices and prices based on square meter in the product table. How
> can I get the price both ways into the price field in the subform? The square
> meter calculation works very well. Either one of them retrieves the price,
> but no both simultaneously.
Carl Rapson - 30 May 2007 16:22 GMT
Again, it's not clear what you're asking. What do you mean, "write the price
at the same field"? Why is writing into it not possible? Can you show us the
code you're trying to use?

Carl Rapson

>I did it!
> Many days I hit my head at wall, but now it works. Still is one problem, I
[quoted text clipped - 11 lines]
>> price,
>> but no both simultaneously.
Mark Anders - 31 May 2007 07:24 GMT
I am sorry, my english is not very good, but I try to explain. The code in
the query is:
Price:IIf([m2Price]>0;[m2Price];[UnitPrice])
and this comes into the subform field (Price). Because it based on
calculation it does not allow to write in the field. I have tried put the
code as defaut value and UnitPrice as control source but the field gives
message #Name?#. As I said, occassionally need to write in the field. The
original question have solved with this code. Writing problem is new one.
Thanks for interest!
Signature

Have a Nice Day!

"Carl Rapson" kirjoitti:

> Again, it's not clear what you're asking. What do you mean, "write the price
> at the same field"? Why is writing into it not possible? Can you show us the
[quoted text clipped - 17 lines]
> >> price,
> >> but no both simultaneously.
Carl Rapson - 31 May 2007 17:54 GMT
Instead of putting the IIf statement into the Control Source of the Price
field, put the code into the subform's Current event instead. That way,
whenever the user moves to the record, the Price field will be calculated
and displayed, but the user can still enter a different value.

Carl Rapson

>I am sorry, my english is not very good, but I try to explain. The code in
> the query is:
[quoted text clipped - 29 lines]
>> >> price,
>> >> but no both simultaneously.
Marshall Barton - 31 May 2007 19:18 GMT
>Instead of putting the IIf statement into the Control Source of the Price
>field, put the code into the subform's Current event instead. That way,
>whenever the user moves to the record, the Price field will be calculated
>and displayed, but the user can still enter a different value.

That is not a good idea, Carl.  Just navigating to a record
is not sufficient reason to change a value, especially if a
user had set it previously.

I don't really understand what Mark is tring to do here, but
maybe some code in the form's BeforeUpdate event can check
if the value is Null and only then set it.

Signature

Marsh
MVP [MS Access]

Steve - 31 May 2007 16:41 GMT
How about setting up all your product prices based on square meter. For the
products that have a unit price, set W and H both to 1.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com

> Hi all!
> I am building a subform for order details and pricing with Acces 2003.
[quoted text clipped - 4 lines]
> meter calculation works very well. Either one of them retrieves the price,
> but no both simultaneously.
 
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.