Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Table db Design > Larger field th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 12078 of 12659
Post > Topic >>

Larger field than thought?

by "Tim" <noemail@[EMAIL PROTECTED] > Aug 1, 2008 at 02:28 PM

When I created the database we use (3 years ago), I thought that the
largest 
number we would hit would be 999.  Well, we are at the high 800's now on a

few of the fields we use.  What I do is use my own table to keep the
current 
count on records.  So a new part # would end with 862, and then the next
one 
would be 863, etc...

Obviously with the code snippet below, you can see how the earlier stages
of 
numbers 1 through 99 would be upgraded to be a 3 digit code to build onto 
the first ****tion of the part number.

Do While Len(strTempStr) < 3
            strTempStr = "0" & strTempStr
        Loop

I have the database create it's own part numbers, and so the first entry 
into a category could be like;

B-APP-001

But since the actual count is only a numeric 1 pulled from the counter
file, 
I check to make sure the number generated gets filled with preceeding
zeros 
so all part numbers have the same lengths.

As I see it, I can change the above routine to check for 4 digits, instead

of the 3 it currently does when new parts are generated.  However, I would

like to convert all existing part numbers over to the 4 digits so that all

parts would have a new 10 digit part number instead of the current 9
digit.

So B-APP-001 would turn into B-APP-0001.

Adding new numbers is an easy fix, but changing all existing part numbers
in 
the system, can I run a query update that would take all part numbers
(4,000 
part numbers) and just have it add the extra ZERO?

IE: Some form of loop to go through all parts in the database

Get next part number in database
New part number Left(6) + "0" + Right(3)
Loop back to get next part

Can anyone give an example of code to put in an update query (if that is
the 
place I should do this) so that I can change all my part number from 9 
digits to the new proposed 10 digits?

I have only done update queries twice, and that with the help of this
group.

Thank you for any help you can provide.

Tim
 




 7 Posts in Topic:
Larger field than thought?
"Tim" <noema  2008-08-01 14:28:10 
Re: Larger field than thought?
"Steve" <non  2008-08-01 19:18:40 
Re: Larger field than thought?
John W. Vinson/MVP <pl  2008-08-01 17:52:27 
Re: Larger field than thought?
=?Utf-8?B?SmFjcXVlbGluZQ=  2008-08-03 14:05:00 
Re: Larger field than thought?
John W. Vinson/MVP <pl  2008-08-03 17:37:40 
Re: Larger field than thought?
=?Utf-8?B?SmFjcXVlbGluZQ=  2008-08-04 11:46:01 
Re: Larger field than thought?
"Tim" <noema  2008-08-04 09:13:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 21:51:09 CST 2008.