If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Select fields on a form and put this data into a specific table.
Hi! I’m trying to find the answer to this problem:
I made a form where users can put their data in. This form has a date-field, a text-field and a field witch content a numbers. I made a Submit button, and I want that the above mentioned fields (in this specific form) will be selected by a query (or something like that) and will be stored in my table "T_OE_Ideas_Queried". Does anyone know how to do this via a query or VBA? Kind regards, Stefan van der Hooft. |
#2
|
|||
|
|||
Select fields on a form and put this data into a specific table.
Using Jet? To refer to a control use the syntax:
FORMS!FormNameHere!ControlName To insert data in a table, if data is 'constant', use syntax like: INSERT INTO table1(field1, field2) VALUES(22, 'hello' ) or INSERT INTO table1(field1, field2) VALUES(FORMS!myForm!control1, FORMS!myForm!control2 ) If data is from another table, you use a INSERT INTO ... SELECT rather thatn the INSERT INTO... VALUES: INSERT INTO table1(field1, field2) SELECT field3, field4 FROM myOtherTable WHERE field5=FORMS!myFormNameHere!someControlNameHere Once you have the statement, as a string or as a saved query, you can runSql it from the DoCmd object (NOT the CurrentDb object, if you use FORMS!FormName!ControlName syntax): DoCmd.RunSQL "INSERT INTO ... " Hoping it may help, Vanderghast, Access MVP "Stefan van der Hooft" wrote in message ... Hi! I'm trying to find the answer to this problem: I made a form where users can put their data in. This form has a date-field, a text-field and a field witch content a numbers. I made a Submit button, and I want that the above mentioned fields (in this specific form) will be selected by a query (or something like that) and will be stored in my table "T_OE_Ideas_Queried". Does anyone know how to do this via a query or VBA? Kind regards, Stefan van der Hooft. |
Thread Tools | |
Display Modes | |
|
|