Question Insert Query

asif pasha

Registered User.
Local time
Today, 08:41
Joined
Jan 8, 2010
Messages
60
Hi All,
I have the data in form and it is not connected to the table, i want the data to be saved in the table through code. Something like insert into table sql statement.
For example i have the following database table Fields.
Name EmpId secondname

and i looking the data to be updated in the table as follows

Asif 589 Pasha

Through code or by running query.

Thanks in advance.
 
What is your reason for making it unbound?

To be honest with you if you don't know how to write code to perform an Insert operation then you will struggle to manage an unbound form. I would advise you go back to using a bound form.
 
HI vbaInet, Thanks for your quick reply, i understand that it would be difficult to handle, but everyone try to improve their knowledge, i have done no of databases with the codes, and many a times i struggle a lot due to one or the other issue, so i thought of unbound the form, then update the data into the table.
I would easily understand the code if i have a sample database and then try creating for our process.
I would really appreciate i you can help me out on this.

For your information i use MS 97 .

Thanks once again.
 
* Create the Append Query
* Copy the SQL statement from the query and put it in this:
Code:
DoCmd.RunSQL "INSERT statement from query here"
 
Thank you so much. Sometime a simple thing looks heavy on head....
 
You're welcome.

If you want to temporarily turn off the messages that pop-up, do this:
Code:
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT statement from query here"
DoCmd.SetWarnings True
Or if you don't want to keep turning it off and on, just use this:
Code:
CurrentDb.Execute "INSERT statement from query here"
 

Users who are viewing this thread

Back
Top Bottom