A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Select fields on a form and put this data into a specific table.



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2007, 01:00 PM posted to microsoft.public.access.queries
Stefan van der Hooft
external usenet poster
 
Posts: 25
Default 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  
Old February 23rd, 2007, 01:54 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.