473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Storing a calculated value in an Access table

I have three fields on a form First Name, Last Name and Card holder name. The data entry person enters first name and Last Name and I calculate the thrird field , Cardholder Name, from the first two fields. I would like to store the cardholder Name in the table with the first and last names. How can I do that?
Nov 18 '16 #1

✓ answered by PhilOfWalton

It is normally very bad practice to store a calculated value in a table. What happens when you inadvertently change the CardHoldeName? How are you going to automatically alter the FirstName & LastName to reflect the change?

Why do you want to store this field as a Query will show it perfectly well?

Use
Expand|Select|Wrap|Line Numbers
  1. CardHolderName = FirstName & " " & LastName
  2.  
or
Expand|Select|Wrap|Line Numbers
  1. CardHolderName = LastName & ", " & FirstName 
  2.  
I Also strongly suggest you don't have spaces in both field names and table names as they have to be surrounded with square brackets which I find a pain.

Phil

2 1825
PhilOfWalton
1,430 Expert 1GB
It is normally very bad practice to store a calculated value in a table. What happens when you inadvertently change the CardHoldeName? How are you going to automatically alter the FirstName & LastName to reflect the change?

Why do you want to store this field as a Query will show it perfectly well?

Use
Expand|Select|Wrap|Line Numbers
  1. CardHolderName = FirstName & " " & LastName
  2.  
or
Expand|Select|Wrap|Line Numbers
  1. CardHolderName = LastName & ", " & FirstName 
  2.  
I Also strongly suggest you don't have spaces in both field names and table names as they have to be surrounded with square brackets which I find a pain.

Phil
Nov 18 '16 #2
thank you for the response. I ended up doing exactly what you suggested and it works great.
Nov 26 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase,...
3
by: anewbie | last post by:
hi. ive been searching for help with storing images in access. after much hunting i found this bit of code that Cor Ligthert put up on another forum. but when i try to update to the dataset, i...
2
by: Bubb | last post by:
I have an Access database with one table that I use for stuff I sell online. Each record has the following fields: Unique Id, Cost, and Item Description. I just obtained some more stuff with its...
11
by: James Hallam | last post by:
I have read through all the past topics and couldn't find what I was after so... I am looking to store some calculated values (don't flame just yet, just read on!). I have an piece of code...
3
by: Mamunul | last post by:
Hi all, I need your help i.e. I want to save some data to the respective table which is calculation in the FORM.
1
by: Prashantsd | last post by:
Hi, I have problem storing the calculated value in table. I have a text box(Ranking) which display the sum of 4 combo box. this is wat I hav done in control source of tex box = + + + I...
2
by: latifju | last post by:
I am new in access. Now I am using MS Access 2010. Problem: I have table named customer with 6fields as follow 1. ID 2. Name 3. Received 4. Paid 5. Balance 6. Date
3
by: prasad joshi | last post by:
i am making a program in that i am doing calculations after doing calculation i want to store calculated value in another table but i dont know how to insert calculated data in table ...
2
by: djgeverson | last post by:
On my form I have a calculated value text box which is the sum of 5 text boxes. I have three error messages which I want to appear "high risk" "low risk" and "medium risk" depending on the value in...
4
by: Ucrandy | last post by:
Access 2010. Is there a way to SUM an AVERAGE calculated value with another field. They will sum individually but not together. In my report, Im using: =Avg() to get the correct average for this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
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...

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.