Solved

Storing number in field

Posted on 2014-01-28
8
338 Views
Last Modified: 2014-01-29
I have a check mark on a form. Every time the check mark is checked, I would like the value in the field titled: "rawnumber" to be multiplied by 2.25 and stored in the field titled "SavedNumber". Once after the proper number is stored I want it to clear what was in the "RawNumber".

Note the field where the number is entered is an unbound field. Not sure if that matters. I am guessing I do an "After Update" event for the check mark?
0
Comment
Question by:cansevin
  • 4
  • 4
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39815929
use the click event of the checkbox.

you can do the multiplication every click ( check or uncheck) or only if the checkbox is check.
0
 

Author Comment

by:cansevin
ID: 39815932
What would the code look like?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39815950
private sub chekbox_click()
dim varNumber
varNumber=nz(me.SavedNumber,0)
if varnumber>=<some value> then
me.SavedNumber=varnumber
exit sub
else
      varnumber= varnumber + me.rawnumber * 2.25
      me.savenumber=varnumber
end if

end sub


some what like that, give more details
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:cansevin
ID: 39817830
Rey... thanks for your help on this! Trying to finish it this morning.

I used your code... there seems to be a problem with the line:

"if varnumber>=<some value> then"

It is highlighted Red when I put it in. Also, When I click the check box, it takes me to the code with that line highlighted.

Any ideas? Thanks again!
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39817863
you have to replace "<some value>"  with a number, according to what you stated above

Once after the proper number is stored I want it to clear what was in the


is that a max limit or what?
0
 

Author Comment

by:cansevin
ID: 39817906
Not sure I explained myself properly... when the check box is clicked. It will muliply what is in RawNumber by 2.25 and store the result in SavedNumber. Then it will erase what was entered in RawNumber.

Does that clarify?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39817928
private sub checkBoxName_Click()

if me.checkboxName=-1 then
me.savednumber=me.rawnumber * 2.25

me.rawnumber=""

end if

end sub
0
 

Author Closing Comment

by:cansevin
ID: 39817957
Thanks!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question