?
Solved

Adding number to text field

Posted on 2014-01-13
5
Medium Priority
?
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39776922
change "CInt" to "Clng"
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 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 40

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…
Suggested Courses

801 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