create table based on textbox

Jaye7

Registered User.
Local time
Tomorrow, 06:01
Joined
Aug 19, 2014
Messages
205
I have a userform that has 4 textboxes and a command button.

The user types in box1 a Rack, in box2 a shelf, in box3 a place and in box4 a shelf.

The user types in Rack textbox 18
The user types in Bay textbox 4
The user types in Shelf textbox 2
The user types in Place textbox 3

I then would like to create that amount of records in a new Temp table.

The attached file shows what the results of the output should be.
 

Attachments

Hi JHB,

I checked out the 2 links, but they are quite a bit beyond my ability, I don't even know where to begin with them.
 
Sorry - but then I need to know, what are you ability then?
I mean, how do you think it could be done, in which way you're able to understand it?
 
I thought that maybe some kind of vba loop through the textboxes, so it would loop adding/ appending the records to the table if they were below the specified textbox values for each bat then shelf then place.

Not sure exactly how to explain it.

But if they were to put 18 1 1 2 it would out put 2 records

18 1 1 1
18 1 1 2

If they put 18 1 1 3 it would output 3 records

18 1 1 1
18 1 1 2
18 1 1 3

With 18 4 2 3 There should be around 24 outputs

18 1 1 1
18 1 1 2
18 1 1 3

18 1 2 1
18 1 2 2
18 1 2 3

18 2 1 1
18 2 1 2
18 2 1 3

18 2 2 1
18 2 2 2
18 2 2 3

18 3 1 1
18 3 1 2
18 3 1 3

18 3 2 1
18 3 2 2
18 3 3 3

18 4 1 1
18 4 1 2
18 4 1 3

18 4 2 1
18 4 2 2
18 4 2 3
 
Okay now I got it - [FONT=&quot]I[/FONT][FONT=&quot] thought you would create a table with what you had entered in the four text controls.
"[/FONT][FONT=&quot]The user types in box1 a Rack, in box2 a shelf, in box3 a place and in box4 a shelf.
[/FONT]Yes you're on right track - do it using some loops and insert/add the values from the loops using a recordset object.
 
That's the problem, I am not sure how to do the loop.

I can use basic excel loops, like if cell.value = 1 etc... but not complex loops.
 
I've made a sample for you in the attached database!
..
I can use basic excel loops, like if cell.value = 1 etc... but not complex loops.
It is more or less the same in MS-Access - and Google is a very good tool for finding solutions!
 

Attachments

Thanks for coming through JHB,

I spent hours trying to figure out how to do a loop, but just aren't smart enough to work it out.
 

Users who are viewing this thread

Back
Top Bottom