MattBaldry
Self Taught, Learn from the Forums
- Local time
- Today, 15:08
- Joined
- Feb 5, 2019
- Messages
- 293
Hello again forumers.
I am after some advice on a query that will add multiple rows into a table from an unbound form. I will try to explain below what I need.
We buy cable from a supplier and it comes in by the reel. We have to assign a batch number to each reel IE 123456-001, 002, 003, 004 and so on. At the moment he has to add each one by hand. On our last shipment we received 50 reels of one cable type, so he had to add 50 lines.
I am after a code that would allow him to input the batch number and total number of reels and when he clicks add, it will add all 50 lines, generating the reel number for each one IE 123456-001 - 050.
My table is called tblCableReel and the fields are as below.
CableID - FK (uses the PK from tblCable)
CableReedID - PK (Autonumber reel ID)
CableReelBatch - Batch number
CableReelNumber - Reel number from this batch IE 1-50
CableReelDate - Date it was booked in
CableReelLength - The length of cable on the reel
CableReelEmployee - FK (The ID of the employee booking the cable)
CableReelFinished - Yes/No, used to mark the reel complete once all cable has been used.
I have written plenty of insert queries to do a single line, but I need a code that will add as many lines as the employee selects in the form.
Thank you for your input and advice as always.
~Matt
I am after some advice on a query that will add multiple rows into a table from an unbound form. I will try to explain below what I need.
We buy cable from a supplier and it comes in by the reel. We have to assign a batch number to each reel IE 123456-001, 002, 003, 004 and so on. At the moment he has to add each one by hand. On our last shipment we received 50 reels of one cable type, so he had to add 50 lines.
I am after a code that would allow him to input the batch number and total number of reels and when he clicks add, it will add all 50 lines, generating the reel number for each one IE 123456-001 - 050.
My table is called tblCableReel and the fields are as below.
CableID - FK (uses the PK from tblCable)
CableReedID - PK (Autonumber reel ID)
CableReelBatch - Batch number
CableReelNumber - Reel number from this batch IE 1-50
CableReelDate - Date it was booked in
CableReelLength - The length of cable on the reel
CableReelEmployee - FK (The ID of the employee booking the cable)
CableReelFinished - Yes/No, used to mark the reel complete once all cable has been used.
I have written plenty of insert queries to do a single line, but I need a code that will add as many lines as the employee selects in the form.
Thank you for your input and advice as always.
~Matt