473,394 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

High Order Zeros Edit Issue

Hi::

I have 2 fields, an alphabetic and a number. I wish to combine them so that they form a
field which has 5 positions in it.

Number can be from 1 to 9999
Letter from A to Z

I planned to concatenate them thus:Letter&Number to form a field that looks like the
following:
A0001
B0001
Z0901
etc

However I have encountered a snag. I know there must be a simple way to force the high
order zeros in front of the number, but I just have no idea what it is.

Can someone enlighten me please?

Thank you

John Baker
Nov 13 '05 #1
5 1559
Format(intYourNum, "0000") should do it. Because it will have an alphabetic
character in it, you will have a string or text, not a number.

Larry Linson
Microsoft Access MVP

"John Baker" <Ba******@Verizon.net> wrote in message
news:ia********************************@4ax.com...
Hi::

I have 2 fields, an alphabetic and a number. I wish to combine them so that they form a field which has 5 positions in it.

Number can be from 1 to 9999
Letter from A to Z

I planned to concatenate them thus:Letter&Number to form a field that looks like the following:
A0001
B0001
Z0901
etc

However I have encountered a snag. I know there must be a simple way to force the high order zeros in front of the number, but I just have no idea what it is.

Can someone enlighten me please?

Thank you

John Baker

Nov 13 '05 #2
John Baker <Ba******@Verizon.net> wrote in
news:ia********************************@4ax.com:
Hi::

I have 2 fields, an alphabetic and a number. I wish to combine
them so that they form a field which has 5 positions in it.

Number can be from 1 to 9999
Letter from A to Z

I planned to concatenate them thus:Letter&Number to form a
field that looks like the following:
A0001
B0001
Z0901
etc

However I have encountered a snag. I know there must be a
simple way to force the high order zeros in front of the
number, but I just have no idea what it is.

Can someone enlighten me please?

Thank you

John Baker

Use the format() function to display the leading zeroes.

[field1] & format([field2],"0000")

Bob Quintal

Nov 13 '05 #3
On Sat, 26 Jun 2004 21:12:37 GMT, John Baker <Ba******@Verizon.net>
wrote:

Check out the Format function:
i = 901
?Format("0000", i)
0901

-Tom.

Hi::

I have 2 fields, an alphabetic and a number. I wish to combine them so that they form a
field which has 5 positions in it.

Number can be from 1 to 9999
Letter from A to Z

I planned to concatenate them thus:Letter&Number to form a field that looks like the
following:
A0001
B0001
Z0901
etc

However I have encountered a snag. I know there must be a simple way to force the high
order zeros in front of the number, but I just have no idea what it is.

Can someone enlighten me please?

Thank you

John Baker


Nov 13 '05 #4
Try using Format...

Public Sub AlphaNumeric(ByVal strPrefix As String, ByVal intStartSeq
As Integer, ByVal intStopSeq As Integer)
'sample result:
'AlphaNumeric "X",1,20
'X0001
'X0002
'X0003
'X0004

Dim intCounter As Integer

For intCounter = intStartSeq To intStopSeq
Debug.Print strPrefix & Format(intCounter, "0000")
Next intCounter
End Sub
Nov 13 '05 #5
Thankyou all very much. Most helpful.

I knew it was simple IF you knew what to do!

John Baker

John Baker <Ba******@Verizon.net> wrote:
Hi::

I have 2 fields, an alphabetic and a number. I wish to combine them so that they form a
field which has 5 positions in it.

Number can be from 1 to 9999
Letter from A to Z

I planned to concatenate them thus:Letter&Number to form a field that looks like the
following:
A0001
B0001
Z0901
etc

However I have encountered a snag. I know there must be a simple way to force the high
order zeros in front of the number, but I just have no idea what it is.

Can someone enlighten me please?

Thank you

John Baker


Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
1
by: MultiTaskinG | last post by:
I want to retrieve all comment stored from my web users ordered BY THREAD and BY TIMESTAMP (INT 11) with a single query (if is possible) now I launch this query: SELECT thread, timestamp,...
1
by: Gary D. Rezek | last post by:
Hi All, I've got a set of asp pages used to register students into the ResNet database. Testing things out under different browser security settings I ran into a problem. The following buttons.......
12
by: eduardo.padoan | last post by:
I'm reading about "high order messages" in Ruby by Nat Pryce, and thinking if it could be util and if so, if it could be done in Python. Someone already tried? References:...
8
by: Mabden | last post by:
For some reason I seem to prefer "zeroes" with an e when it stands alone, but "zeros" when it's a compound word like "all-zeros". Is there a C standard for this? Is it a Left-pond / Right-pond...
2
by: Support | last post by:
Hello: I am trying to learn about Aactive Directory in VB.NET and NT security, so if you have any good resources/references, please let me know. At a high level ... in VB.NET If I am a...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
7
by: leninv | last post by:
Hi, I have the following code where 'recs' is a record set. For i=0 to recs.Fields.Count - 1 if i = 0 then pindnt = string(itmlvl*2," ") response.write pindnt &...
3
by: ManuelValdez | last post by:
Hello everybody! I need your valuable help to get an Excel macro to delete the single zeros only and no the zeros containing numbers like 360, 90, etc., because if I chose the search and replace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.