creating a table using variables

R

r_young_81

I am stumped trying to figure this out and would appreciate any input.

I need to make a table with variable fields based on user input.

It seems that there should be a really easy solution but I have yet to
figure it out.

Thanks in advance,
Ray
 
R

r_young_81

I have a form and table for user input to initiallize the database, basically
client name and a number variable. I want to take this number and create a
table with a few set fields and fields of the number input, i.e.:

User inputs 3

SetField1 SetField2 VarField1 VarField2 VarField3

If the user inputs 4 then an additional field, Varfield4, would be added.

Thanks again.
 
R

Rick B

You are still not really telling us what you are doing, but...

This sounds like a classic one-to-many relationship. You would create a new
table for the variable(s) and it would have two fields: Client number
(which would match your client table) and variable. If the user needs one
variable, they would create one record. If they need ten, they would create
ten records.

In a form, this would be represented as a continuous subform. I'm pretty
sure there are samples of this type of setup in the Northwinds sample
database. You might look at how it handles invoices and invoice detail
lines.

Classic one-to-many.


Rick B
 
R

r_young_81

To initiallize this database, the user inputs the client name and the number,
which will be the number of fields added to a table that needs to be created
and that has 2 set fields (will always be present with any input value). I
want to take that input number, X, and add X fields to table Y. Such that if
the client put in 3, a table would be created with 2 constant, predefined
fields, and 3 added variable fields.

User input 3:

SetField1 SetField2 VarField1 VarField2 VarField3

I assume that VB scripting would be the easiest way to create the table.

Hope this clarifies my needs a bit better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top