reserve multiple records

no! basically we would be reserving about 20 to 40 wires at a time. currently we have about 10k wires total. the issue is that we have gaps in the numbering say from 5000 to 5500 so we would like to fill those gaps so we might reserve wire number 5001-5040 and print out the labels. as we use the numbers we go back into the DB and fill out the rest of the details. Obviously though we don't want employee 1 and employee 2 trying to use the same wire number at the same time which is why we need to reserve the number first
 
Ok, I need to know the following;
What number to start from.
What number to end on.
What has been used to date.

Dale
 
we have been using an old Lotus db program as for the starting and ending numbers those would be user selectable. basically a text box on the form asking what number you want to start with and how many numbers you want to reserve either that way or have the end user input the beginning number and the end number
 
I am lost.
How can I give you a wire number if I don't know what has been used.
If wires 60 to 80 are in use I can not let the database reserve them.
How will the user know what number to start with?
I think I am missing something.

Dale
 
There is another button on the choice form that I think I took off to simplify the DB for upload where they can search for missing gaps of numbers





Edit: I looked again at the sample DB and the search is still on the choice form. and all those queries are needed to search for the gaps. that must be why you said that it looked like such a mess :)
 
Last edited:
Just the table. Not the queries.
After looking at it, it will be OK I think.

If you have all the gaps. What do you need now?
Just pick a gap and take 20 wires.

Are you looking for something to tell you what 20 wire numbers?
Sorry, I get confused easily.
EDIT: You have a small bug in one of your queries.
It shows wires 5-7 and 15 - 17 as a gap.
Dale
 
wow now that you point that out I just looked and ya you are right about the bug! I will have to look at that!

now that we have the gaps I want to be able to pick say 20 or 40 numbers out of that gap and reserve those numbers so no one else can pick them.so in other words if we need 15 numbers our users can look for a gap of numbers and pick 15 numbers and reserve them. in the end once all the gaps are filled up they still need to be able to reserve wire numbers at the end of the list and keep adding wires to the end of the DB. not to mention as we remove old equipment and delete the wirenumbers from the DB then those numbers would then again be available to us
 
I got the gaps to fill using Q_DataStatus.
I assume your are going to task me to add this to your wirelist table as reserved.:p

I will add a field to the table and call it Reserved.

Dale
 
actually there is already a field for that. the field is called done. if it is a 1 then it is done, if it is a 2 then it is reserved

ya All I need the script to do is in the done field add a 2 and in the wire number field add the wire number from x to y so say you want to reserve 5 numbers and start at wire number 3355 then there would be a record created for 3355 and in the done field a 2 would be added then same with wine number field3356 done field2 wine number field3357 done field2 wine number field3358 done field2 wine number field3359 done field2
 
Last edited:
thank you so much for your help! I greatly appreciate it! I'll look at it tonight then get back to you on Monday :) damn how in the hell did you get it to compress that small :)
 
MONDAY..... You don't work on Saturday?

I will be here all weekend.

Dale
 
OMG thanks! lol I never would have figured that out on my own!
 
nope this weekend I will be racing :) again thanks SO much!
 
It has been my pleasure.

I am sure you will have questions on Monday.

Whatever it is you race, be careful and have a great weekend

Dale
 
Wolf,
I forgot to close a recordset.
I added some comments to help you if you need to change things.

New code. This is just code,form and a table.
This will need to be inserted/copied into you existing database.

View attachment Wolf.zip

Dale
 
rzw0wr
this worked GREAT! thanks
1 question though
Code:
With rsWireList
        .AddNew     'tell recordset we are going to add new records
        ![Wire Number] = intWireEnd ' input wire number into recordset. will be add to the bottom but does not matter
'If you need to change what you are adding to the table. insert it here.
'Use the ! Bang before the field name.
'The following line might be !Done = "yes" or however you like.
'NOTE; YOU CAN NOT CHANGE OR RELACE DATA THAT IS IN THE TABLE AT THIS TIME. ONLY ADD NEW DATA.
        !DONE = "1"  'in same record add "2" to the Done field.
        .Update         'update or save the recordset
        .Bookmark = .LastModified 'Bookmark the record
    End With
if I add right below !DONE another field such as todays date and tech would that add those fields as well? and is that all I would need to do? Or would I have to change something somewhere else as well (Obviously I would need to add the tech field to the form)
 
Add what ever you like just keep it before the .Update.

Dale
 

Users who are viewing this thread

Back
Top Bottom