Automatically Finding Numbers

Toledo123

Registered User.
Local time
Today, 03:07
Joined
Sep 21, 2012
Messages
12
I have a two part question!

1. I have a database that tracks "coils" for a steel company. One the coil is all used up and the weight is "0" I want to be able to delete that coil from the data base so I don't end up with a 200 page report showing coils with a weight of "0". I know how to block the records from showing up on a report but I want to delete them so that I can reuse that coil number again in the future. What is the easiest way to do this.

2. I have the coil number to automatically generate the next coil number when a new record is entered. Is there a way to tell access to go back and find the coil numbers that are not accounted for (because they were deleted) and reassign that number to a new coil

I hope at least some of this made sense thanks for any help you can give me.
 
No need to delete them. Just use a query as the report's record source (you can use a query in 99% of the places you would use a table) and put criteria on the weight field of >0.

Then just keep adding the new ones, but the ones with 0 will drop off of the report.
 
I realize that you can do that however, I want to reuse the coil number.

Example:

We receive a coil today and number it 256. By December we have used all that coil so I want to delete the record from the data base. In February we receive another set of coils and I want to number one of them 256. It is my understanding that I can not do that unless the first 256 is already deleted.
 
Just use an autonumber as the PK and then include a CoilNo field which you can number just like you want. Then you can have the best of both worlds.
 
That is what I have but I still need to delete the record when the coil gets down to 0 so I can reuse the coil number don't I. Can Access go back and find gaps in the numbering and automatically fill them in?
 
That is what I have
No, you didn't say that. You said you created the Coil number automatically and that would tend to indicate to me that you are using an Autonumber. But I didn't say to create the Coil Number as an Autonumber.

[/quote] but I still need to delete the record when the coil gets down to 0 so I can reuse the coil number don't I[/quote] If the Coil Number is not an autonumber and is set to be Indexed(Duplicates OK) then you can just reuse the number.
Can Access go back and find gaps in the numbering and automatically fill them in?
You can do almost anything you want through code. So, if you want to do that, then the code can be generated which would assign the first number that it finds with a weight of 0 to the new coil.
 
Is there a place that I can look to find out what that code might be? Or is there information I can give you where you can help me write the code?
 

Users who are viewing this thread

Back
Top Bottom