How to automatically total rows in a subform

Creating and using forms

How to automatically total rows in a subform

Postby Ron19855 » Thu Dec 27, 2018 11:48 pm

Hello,

I'm looking to multiply quantity by price and display the value in a field called subtotal. I've included an image that shows where I currently stand. The main form is my Order table, while the subform below is pulling from my OrderDetails table. I also have a product table which is where productPrice is stored. Is there a way to multiply productPrice from the product tbl and quantity from the OrderDetails tbl and then display them at the end of each row of the subform? I know in Access there is a function called calculated control which will let you accomplish this but I haven't been able to find similar functionality in Base. I've tried using a query to multiply the two, but I don't know if it's possible to display the query result for each product that belongs to a particular order; I instead was only able to create a new subform that I had to scroll through and didn't dynamically pick out the corresponding values for the order. One other idea I had was to create a query that contained the orderDetails fields plus the subtotal calculation and use that for the subform, but it doesn't appear that you can display queries as a table within a form. I feel like this has to be a common for anyone how wants to create an invoice like this, but I haven't been able to find an answer anywhere. Any assistance will be greatly appreciated. P.S. In the image included, productPrice and subtotal are fields from my query that I tried dragging and dropping onto the subform table, but obviously, they do not display any data. The query is able to display correct data when entered as formatted fields so I know the query is functioning.
Attachments
Capture2.PNG
Screencap of form
OpenOffice 4.1.6 - Windows 7 Ultimate
Ron19855
 
Posts: 1
Joined: Thu Dec 27, 2018 11:25 pm

Re: How to automatically total rows in a subform

Postby UnklDonald418 » Fri Dec 28, 2018 5:21 pm

If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1122
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests