Calculated field - in query or txtBox control (1 Viewer)

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
Should I get the extended price for a product on an order by creating a calculated field in the query recordset for the form's data, or just do the calculation on the form?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:49
Joined
May 7, 2009
Messages
19,230
best is use query.
 

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
I am struggling to understand what makes some of my queries produce un-editable recordsets.
 

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
Trying to figure out how to get my main query editable when all of the underlying subforms use queries with calculated fields
 

mike60smart

Registered User.
Local time
Today, 00:49
Joined
Aug 6, 2017
Messages
1,904
Trying to figure out how to get my main query editable when all of the underlying subforms use queries with calculated fields
Hi
Can you upload a screenshot of your Query showing the Tables & Relationships?
 

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
I am trying to remove a calculated field from a table but when I build a query to run the calculation from a related table the main query's recordset becomes un-editable. how do I accomplish this?
 

mike60smart

Registered User.
Local time
Today, 00:49
Joined
Aug 6, 2017
Messages
1,904
Hi
It would help if you can upload a screenshot of the Query or better still a copy of the database?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:49
Joined
Feb 28, 2001
Messages
27,167
In simple terms, a query is editable if every field in the query has some unique place to go when you save it. If it has no unique destination, you cannot edit using the query.

An SQL aggregate cannot be edited because it groups records in a summary and the edit cannot change the whole summary.

An SQL with a calculated field has no place to put the calculation.

Things like that are the basis for non-editable queries.
 

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
In simple terms, a query is editable if every field in the query has some unique place to go when you save it. If it has no unique destination, you cannot edit using the query.

An SQL aggregate cannot be edited because it groups records in a summary and the edit cannot change the whole summary.

An SQL with a calculated field has no place to put the calculation.

Things like that are the basis for non-editable queries.
Thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:49
Joined
Feb 19, 2002
Messages
43,257
I've always wished for a smarter query engine for Jet/ACE. It always seemed to me that If I created a query to sum a customer's open orders and joined that query to the customer table, that the fields from the customer table should be updateable even though the query was joined to a non-updatable query. But, sadly, MS thinks differently and there you have it. As the others have mentioned, if one part of a query is not updateable, then none of the query is updateable.
 

slharman1

Member
Local time
Yesterday, 18:49
Joined
Mar 8, 2021
Messages
476
I've always wished for a smarter query engine for Jet/ACE. It always seemed to me that If I created a query to sum a customer's open orders and joined that query to the customer table, that the fields from the customer table should be updateable even though the query was joined to a non-updatable query. But, sadly, MS thinks differently and there you have it. As the others have mentioned, if one part of a query is not updateable, then none of the query is updateable.
Thanks for the info Pat
 

Cronk

Registered User.
Local time
Today, 09:49
Joined
Jul 4, 2013
Messages
2,772
Putting a calculation in a query is OK except where there might be a complex formula and a lot of records because time delay of data load could be compromised.
 

Users who are viewing this thread

Top Bottom