By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,517 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,517 IT Pros & Developers. It's quick & easy.

transfer data from a form to table

P: 5
I want to ask if I can transfer data (rows) from a form to a table other than the one bounded with the form?

I need to transfer specific rows only, can I??
for neccesary!
Mar 13 '15 #1
Share this Question
Share on Google+
5 Replies

Seth Schrock
Expert 2.5K+
P: 2,951
Yes it is possible, but if you have a properly normalized database, then it is very rare that you would need to.

How do you pick which rows that you want to transfer?
Mar 13 '15 #2

P: 5
sorry I didn't get you,
suppose we have a form for costumers details and every month we have to choose some of them and put their details in separate table, how we gonna do this
I am thinking if we can put an button in (detail) part in the (design view) and give a command whenever you click on it will transfer this row (details) to a specific table .
Mar 14 '15 #3

Seth Schrock
Expert 2.5K+
P: 2,951
I would use the Insert Into Select query to do this. The basic syntax is
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO table2
  2. (column_name(s))
  3. SELECT column_name(s)
  4. FROM table1
  5. WHERE ID_column = Current_ID
The On_Click event of your button would build this string and use the value in the ID control for the current record to replace the Current_ID in the syntax above.
Mar 14 '15 #4

P: 5
can you explain more please,,
Mar 14 '15 #5

Seth Schrock
Expert 2.5K+
P: 2,951
Without more information I can't be too specific, but here is about what you need.
Expand|Select|Wrap|Line Numbers
  1. Dim strInsert As String
  2. Dim db As DAO.Database
  4. strInsert = "INSERT INTO table2 " & _
  5.             "(column_name(s)) " & _
  6.             "SELECT column_name(s) " & _
  7.             "FROM table1 " & _
  8.             "WHERE ID_column = " & Me.ControlName
  10. Set db = CurrentDb
  12. db.Execute strInsert, dbFailOnError
  14. Set db = Nothing
Table2 is the table that you are inserting into . Table1 is the table that the information is coming from. Me.ControlNumber is the control whose Control Source is the ID field for your table.
Mar 15 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.