Solved

Storing number in field

Posted on 2014-01-28
8
337 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 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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
 

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

930 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now