473,768 Members | 3,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculated Field?

Hi
Would like to add a new Field to Table which is 75 % (or another
Percentage) higher than the Value in another Field in same Table.Is
this possible with Expression or would I have to enter the Values
manuallyTried to build a Query like this (successful) and then link
the new Field to the Query but was only able to do this as a Combo BOx
and not text field.
This is for a Products Page where I want to base the Retail Price on
the Cost Price
Any Help appreciated
Regards
Manfred
Nov 12 '05 #1
2 2332
Access / Jet (and, indeed, good relational design practices) do not support
calculated fields in tables. You should calculate the value in a query or in
a control on a form or report when the value is needed.

Larry Linson
Microsoft Access MVP

"Manfred" <ad***@cbdafric a.com> wrote in message
news:45******** *************** ***@posting.goo gle.com...
Hi
Would like to add a new Field to Table which is 75 % (or another
Percentage) higher than the Value in another Field in same Table.Is
this possible with Expression or would I have to enter the Values
manuallyTried to build a Query like this (successful) and then link
the new Field to the Query but was only able to do this as a Combo BOx
and not text field.
This is for a Products Page where I want to base the Retail Price on
the Cost Price
Any Help appreciated
Regards
Manfred

Nov 12 '05 #2
If this field should always be 75% of the other (and it would be wrong for
it to be anything else), then Larry is right. You need a calculated field in
a query instead of a field in your table. More information in article:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

If you want to start with 75% of the value and then be able to set different
values for different items, you do need the field in your table. Add the
currency field, and you can automatically populate it with an Update query:
1. Add the new field to your table.

2. Create a query into this table.

3. Change it to an Update query (Update on Query menu).
Access adds an Update row to the query grid.

4. Drag the new field into the query grid.

5. In the Update row under this field, enter:
1.75 * [Cost Price]

6. Run the query.

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

"Manfred" <ad***@cbdafric a.com> wrote in message
news:45******** *************** ***@posting.goo gle.com...

Would like to add a new Field to Table which is 75 % (or another
Percentage) higher than the Value in another Field in same Table.Is
this possible with Expression or would I have to enter the Values
manuallyTried to build a Query like this (successful) and then link
the new Field to the Query but was only able to do this as a Combo BOx
and not text field.
This is for a Products Page where I want to base the Retail Price on
the Cost Price
Any Help appreciated
Regards
Manfred

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2346
by: Norbert Lieckfeldt | last post by:
MS Access 2002 here. I am just trying to set up a simple database for a friend who's an optician. Basically, all clients with address details, date of last eyetest and a drop-down combo box to choose a number of months to the next eyetest (3,6,12,24). I then have a calculated field in the form which works out the date of the next appointment on the basis of the previous two sets of information . All that works . I am now trying to set...
2
5359
by: hhathome | last post by:
In my report I have a calculated DateDiff Field, I also have a calculated count field. I'm trying to get a total of the DateDiff field and dividing it by the count field and I'm having problems -- it seems the calculated field is not storing the data for reuse, maybe -- does anyone have any suggestions? Thanks
2
8003
by: markm75c | last post by:
Does anyone know of a way to sort a column which isnt databound or an actual field in the database, but is derived from a method? IE. I have a grid showing stats for softball, with a calculated field called AVG, I want to be able to sort based on AVG when they click on AVG. I can't seem to find a way to do this out there. Thanks!
2
3618
by: ey.markov | last post by:
Greetings, in A2K VBA, I set the following recordset: Set rsGPValue = dbs.OpenRecordset("SELECT *, DateSerial(Year(),Month()+4,0) FROM tblGPValue AS OurDate, dbOpenSnapshot) and then I try to use this calculated field: If rsGPValue.Fields("OurDate") > {Forms]!!.Value
3
4742
by: kelley.l.turner | last post by:
Hi all, I am very new to MS Access so please bear with me! I have created a simple calculated field in my data entry form, yet when I view my data table or try to generate a report based on this calculated field, no value is posted. How/where do I get my calculated values to also show up in the tables and reports? Thanks, Kelley
5
5887
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public function returns a long string. This works. 2. A query has a calculated field based on the custom function above. This works when the query is run directly.
2
5545
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where...
9
7814
by: Haas C | last post by:
Hi all! Is there anyway I can override a value in a calculated field on a form? For example: I have a form which displays the following fields based on a query: Premium Due field has the value of 12,527.75 in it. Brokerage Due field is the calculated field which multiplies a factor
3
4278
by: Matthew Wells | last post by:
If I have a calculated field that returns a value from a udf, does that field get calculated even when it's not being used in a Select statement? I knw that if a calculated field's formula is based on fields in the same record that the calculation is only performed when one of the two fields is updated. But if I'm calling a UDF, there's no way for SQL Server to know when to update the calculation. (In this case, the UDF does a count of...
2
4283
by: mkbrady | last post by:
I have a query that includes calculated fields that generate numeric results. I have wrapped conversion functions CLng() and CDdl() around the calculated fields to ensure the data types are correct. The query results are correct in MS Access 2007 but when I export to MS Excel 2007, some of the numeric fields are converted to text. I cannot find an explanation. I am using a Macro to export, and would prefer to avoid VBA for this...
0
9577
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9413
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10187
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9971
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9848
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8844
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7390
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5428
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.