Writing data to two places simultaniously

battenberg

Burning candles both ends
Local time
Today, 16:51
Joined
Sep 25, 2006
Messages
118
Hi,

I need to capture data from fields in a form and write it to a table, however, the form is bound to a different table where it exracts/populates most of the fields.

my command button concatenates information in to a single string which writes the values to a [Notes] field against a particular 'Project' in the original table.

I have now been asked to capture the notes outside of the concatenated string and detail them for reports.

So i have created another table to handle this.

My question is this:

The information is held in strings before the concatenation, the command button concatenates the strings and writes to the [notes] field in table1, How can I write the same information to the individual fields in table2 simutainiously using the values held in the original strings.

Any pointers would be appreciated...

thanks
 
You can issue an sql statement to insert the values coming from the text
fields in your form into the new table you have created.

Syntax:

Docmd.RunSql "INSERT INTO table2 (fieldname1,fieldname2,etc) VALUES (forms!yourExistingForm!textField1,forms!yourExistingForm!textField2,etc)"

The number of fields you are placing data into should match the number of source controls otherwise, it will not work.
 
Last edited:
Thankyou, I will try it.
 

Users who are viewing this thread

Back
Top Bottom