Tables

N

Nathan

I need to create a table that has alphanumeric coloum
that is formatted like LLLL1234567 and i want the first
six numbers to auto incramete also i want the last number
to be generated in the sequence
9 7 5 3 0 8 6 4 2 0
so if 2 was then last number in the field before then it
the next one would be 0

also i need to take the field and alter it in a new one
to be the format
LLLL 123456 7

Can anyone help?
Thanks in advance

for more info e-mail me
nathan_rob @ rogers.com
 
T

TonyT

-----Original Message-----
I need to create a table that has alphanumeric coloum
that is formatted like LLLL1234567 and i want the first
six numbers to auto incramete also i want the last number
to be generated in the sequence
9 7 5 3 0 8 6 4 2 0
so if 2 was then last number in the field before then it
the next one would be 0

also i need to take the field and alter it in a new one
to be the format
LLLL 123456 7

Can anyone help?
Thanks in advance

for more info e-mail me
nathan_rob @ rogers.com

.
Do you really need the last digit in the order - 9 7 5 3 0
8 6 4 2 0
as having 2 zero's means you will have to query more than
just the last record to get ensure that the number is
correct, if the 0 after 3 was a 1 insetad it would
simplify things considerably.

TonyT
 
G

Guest

oh yes the 0 after the 3 could be a 1


-----Original Message-----

Do you really need the last digit in the order - 9 7 5 3 0
8 6 4 2 0
as having 2 zero's means you will have to query more than
just the last record to get ensure that the number is
correct, if the 0 after 3 was a 1 insetad it would
simplify things considerably.

TonyT
.
 
T

TonyT

:)) good,

I'm assuming that you don't want 1234569 followed by
1234567 followed by 1234565, but rather 1234569 followed
by 1234577 followed by 1234583.

easiest way I can think of is to create a Query on the
table include the column with the Order Numbers in (i'll
call it colA) and a new field called myField where -
myField: Mid$([Field1],5,4)

dim strLastOrdNum as String
dim strNewOrdNum as String
dim sglLastNum as Single

strLastOrdNum = DLookup("ColA", "Query1", "myfield = " &
DMax("myField", "Query1") & "")

If Right(strLastOrdNum,1) = 1 Then
sglLastNum = 8
ElseIf Right(strLastOrdNum,1) = 0 Then
sglLastNum = 9
Else:sglLastNum = (Right(strLastOrdNum,1) - 2)
End If

strNewOrdNum = "LLLL" & (DMax("myField", "Query1")+1) &
sglLastNum

Bit long winded, probably better ways, but it's been a
long day!!!!

TonyT
 
G

Guest

i don't under stand what to do
can you explain further
or
can you creat it and e-mail me the file???
nathan_rob @ rogers.com

thanks
-----Original Message-----
:)) good,

I'm assuming that you don't want 1234569 followed by
1234567 followed by 1234565, but rather 1234569 followed
by 1234577 followed by 1234583.

easiest way I can think of is to create a Query on the
table include the column with the Order Numbers in (i'll
call it colA) and a new field called myField where -
myField: Mid$([Field1],5,4)

dim strLastOrdNum as String
dim strNewOrdNum as String
dim sglLastNum as Single

strLastOrdNum = DLookup("ColA", "Query1", "myfield = " &
DMax("myField", "Query1") & "")

If Right(strLastOrdNum,1) = 1 Then
sglLastNum = 8
ElseIf Right(strLastOrdNum,1) = 0 Then
sglLastNum = 9
Else:sglLastNum = (Right(strLastOrdNum,1) - 2)
End If

strNewOrdNum = "LLLL" & (DMax("myField", "Query1")+1) &
sglLastNum

Bit long winded, probably better ways, but it's been a
long day!!!!

TonyT
-----Original Message-----
oh yes the 0 after the 3 could be a 1



3
0
.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top