Solved

Adding number to text field

Posted on 2014-01-13
5
592 Views
Last Modified: 2014-01-13
I have a field [Transaction Number] that is formatted as a text field. The value is 000002. I need to add the number 231955 to the value from a query and have it display 231955.

When I use the formula FormatNumber(CInt([Transaction Number]),0,0,0)+[CurrentTransNumber] in the query I get 2231955.

When I use the formula FormatNumber(CInt([Transaction Number]),0,0,0)+CInt([CurrentTransNumber]) I get a stack overflow error.

How do get it to add and not combine text values?
0
Comment
Question by:PetGuy
5 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39776922
change "CInt" to "Clng"
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 39777091
You could simply use:

Format(Val([Transaction Number]) + Val([CurrentTransNumber]), "000000")

/gustav
0
 

Author Closing Comment

by:PetGuy
ID: 39777114
Just what I needed, and fast
0
 
LVL 39

Expert Comment

by:als315
ID: 39777124
In query you should be able to sum numeric text values and number without conversions.
[Transaction Number] + 231955 will be equal 231957 if [Transaction Number] equal 000002 or 002
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39777126
"need to add the number 231955 to the value from a query and have it display 231955.", where is the effect of value 000002?
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

910 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

19 Experts available now in Live!

Get 1:1 Help Now