subform datasheet to populate main table (1 Viewer)

penfold1992

Registered User.
Local time
Today, 23:08
Joined
Nov 22, 2012
Messages
169
hello all!

I have a subform that is essentially a blank table which users can create rows depending on how many they require and fill the table in.

I then want to be able to append a main table with the records that have just been created in the subform's table... but here is where an issue lies.

Main Table has 6 columns... subform table has 5.

I already have the value to put into the 6th column but Im just not sure how to do it... the value is obtained from the original form.

so here is what I hope is possible...
for each record, copy that record into the main table + adding another value into the extra column.

is this possible? or doable?
 

burrina

Registered User.
Local time
Today, 17:08
Joined
May 10, 2014
Messages
972
Hi, very strange setup you have! Normally the subform is populated via the main form and so forth. That said, can you post a Demo copy with all confidential data removed?
Along with explanations.
 

penfold1992

Registered User.
Local time
Today, 23:08
Joined
Nov 22, 2012
Messages
169
Hi, very strange setup you have! Normally the subform is populated via the main form and so forth. That said, can you post a Demo copy with all confidential data removed?
Along with explanations.

well... i have a form where you select a category and it will view all incidents under that category...
if you want to add an incident, id like to be able to fill in the form without having to enter the category (as you already selected the category from the main form)

i guess it doesnt have to be in a subform, it could be in a seperate form that gets brought up from the original form but the idea remains the same... i want to add the category each record.

i am unable to upload as the company blocks any form of uploading =(
 

burrina

Registered User.
Local time
Today, 17:08
Joined
May 10, 2014
Messages
972
Are your main form and subform not linked? Do both forms have a different table?
 

penfold1992

Registered User.
Local time
Today, 23:08
Joined
Nov 22, 2012
Messages
169
Are your main form and subform not linked? Do both forms have a different table?

they will do.. so that one table is completely blank (for entering data)
and the other table is the main table for storing all the data.


I could create a form with a text box for each entry but I might be required to make 30+ rows of boxes... its not an ideal way of doing it. Im sure there is a way to do something like....

Code:
for each row in temp_table
       insert [Category] = category from main table
                [field1] = [field1] from temp table
                [field2] = [field2] from temp table
                [field3] = [field3] from temp table
      run sql
next row
 

Users who are viewing this thread

Top Bottom