473,802 Members | 2,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to enter a value in a field to be calculated and stored

I want to enter a value in a field and for that value that was entered
to be multiplyed by 10 and then stored in a table. How do I do this?

For example:

[testCalc]=[testCalc]*10;

Thanks,
Won Mee
Nov 13 '05 #1
4 2322
Use an event to trigger the update, either a button click, or the after
update event of the field, then use a recordset to add the data to the
table.

Something like.....

Private sub Yourfield_After Update()

dim db as database
dim rs as recordset
set db=current.Db
set rs=db.OpenRecor dset("yourtable name",dbOpenDyn aset)

with rs
..addnew
!TableField = Your field * 10
..update
end with
set rs=nothing
set db=nothing

end sub

Probably easier ways too.

Gerry Abbott

"Won Mee" <wo****@comcast .net> wrote in message
news:4e******** *************** ***@posting.goo gle.com...
I want to enter a value in a field and for that value that was entered
to be multiplyed by 10 and then stored in a table. How do I do this?

For example:

[testCalc]=[testCalc]*10;

Thanks,
Won Mee

Nov 13 '05 #2
On 1 Dec 2004 08:33:15 -0800, Won Mee wrote:
I want to enter a value in a field and for that value that was entered
to be multiplyed by 10 and then stored in a table. How do I do this?

For example:

[testCalc]=[testCalc]*10;

Thanks,
Won Mee


Why would you wish to save it?
Save the underlying value.
Once you have the [testcalc] value stored in your table, any time you
need the [testCalc]*10 calculated, simply calculate it.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3
On Wed, 01 Dec 2004 18:43:48 GMT, fredg wrote:
On 1 Dec 2004 08:33:15 -0800, Won Mee wrote:
I want to enter a value in a field and for that value that was entered
to be multiplyed by 10 and then stored in a table. How do I do this?

For example:

[testCalc]=[testCalc]*10;

Thanks,
Won Mee


Why would you wish to save it?
Save the underlying value.
Once you have the [testcalc] value stored in your table, any time you
need the [testCalc]*10 calculated, simply calculate it.


I meant to write:

Once you have the [testcalc] value stored in your table, any time you
need the [testCalc]*10 calculated, simply calculate it, in a form,
query, or report.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #4


Fred,
HOw do I store a calculated field into a table by a query?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

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

Similar topics

4
4632
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input type="checkbox" name="chk_Complete" value="<%Response.Write l_IsChecked%>"<%if cbool(l_IsChecked) then Response.Write " checked"%>> The code to captures the checkbox value in the asp page that builds the sql string is follows
0
2076
by: Henry | last post by:
Hi Is there any good ideas how to update form vb code always after some values are changed / added by vb (not user). I have some code behind subforms vb and there are calculations behind "Form_Current" section those I need to re-calculate after some values are changed or added. The problem is that if list box value is calculated in vb, access wont
3
2745
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have reports at the plan (overall totals), department and division levels which have sorting and grouping implemented with this new
0
295
by: wonmee | last post by:
How do I calculated a number and store it in a table? Thanks
3
3136
by: markaelkins | last post by:
I want to create a simple user interface to collect the following data and store the data in a SQL database…. Could someone please help me get started? Data to collect from user interface and store in database: tDateS (trade date sell) tDateB (trade date buy) contracts (number of contracts) strike (stike price) sValue (sell value) bValue (buy value)
2
4004
by: MLH | last post by:
Fields in MyTable: PostID PostDate RollQtyXfer RollDenomination RollCount37 RollCount23
3
4747
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
3239
by: vsteshenko | last post by:
Hello, This is my second post to the any usernet group and the first one was posted to the wrong one. I am currently working on creating an order form for sales associates at my work to be used at conventions. I have a main form with two subforms. On the main form, there is a text box that displays the sum of total orders entered in the subform, . I'm trying to create another text box on the main form, that looks at the subtotal...
1
1212
by: Rajeesh123 | last post by:
I have a dom tree in asp with jscript(same kind of treeview in .net). when user clicks on it , I pass the id to a hidden field and update it with ajax. The main page has one if clause to get the condition of hidden field and proceed. This if caluse fetches the data from data base and generates path to root of the clicked node. The path is stored on a server side value. The path is calulated inside a server side script(run at server) and...
0
9558
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
10527
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...
0
9106
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...
0
6834
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
5492
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4267
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2963
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.