Solved

Adding number to text field

Posted on 2014-01-13
5
591 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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…
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now