Formula in Access

I am using the below code. It works perfect until I use really big numbers. When I use numbers 14 or 15 digits long, it comes up an error. Anything I can do so it supports really large numbers?

Private Sub Check18_Click()

If Me.Check18 = -1 Then
Me.SavedNumber = Me.rawnumber * 1.75

Me.rawnumber = ""

End If

End Sub
cansevinAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mbizupConnect With a Mentor Commented:
Btw, sl8rz is correct about needing a datatype that can handle large numbers, but it should be the SavedNumber field that is formatted as Double, Single or anything other than integer/long int in your table's design.

RawNumber, since it is an unbound textbox can handle (almost) anything you place in it.

Take a look at the Supported Field Properties here:
http://office.microsoft.com/en-us/access-help/introduction-to-data-types-and-field-properties-HA010341783.aspx
0
 
David L. HansenProgrammer AnalystCommented:
Me.rawnumber may have a datatype of "Integer" or "Long"...you may need to change this so that it can handle larger numbers such as what you've been giving it.  I suggest using "double."

Look at this page: http://www.seattlecentral.edu/~cstanford/itc220/datatypes.pdf
or
http://www.w3schools.com/sql/sql_datatypes.asp
0
 
cansevinAuthor Commented:
Is that something I change on the form or on the table? That field isn't hooked up to a table... so I hope I can change it on the form.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mbizupCommented:
Are you getting a VBA error?  (Which one?)

Or is the form displaying #Error?
0
 
David L. HansenProgrammer AnalystCommented:
There is likely a simple "Dim rawnumber" statement in the form's code.  It declares that variable (just do a find...Ctrl + F to find it).  On that line of code you'll see explicitly what the datatype is.
0
 
cansevinAuthor Commented:
Yes... VBA error.

"The value your entered isn't valid for this field".
0
 
mbizupCommented:
(This is in the 'Field Properties' section shown in the bottom part of your table design window)
0
All Courses

From novice to tech pro — start learning today.