Append data to a table

  • Thread starter Thread starter T Liden
  • Start date Start date
T

T Liden

I need to append data that is showing in a form to a table.

Most of the controls are bound to a query's fields, but there are a few text
boxes that the user inputs some infomation into manually that needs to be
appended as well.

The user chooses a job # and then the info for that job comes up from the
query. The user then fills in the text boxes with the appropriate info and
then I want them to click on a button to append the data to an existing
table.

Could you please give me some example of the VB code that I would use to
execute this procedure?

Thanks!!
Tim
 
Hi Tim,

My name is Dennis Schmidt. Thank you for using the Microsoft Windows
Installer Newsgroups.

The following should get you started in the right direction:

Function SaveData()
Dim MyDB As Database, MyRS As Recordset
Set MyDB = CurrentDb()
Set MyRS = MyDB.OpenRecordset(NameOfTable, dbOpenDynaset)
MyRS.AddNew
MyRS![FirstFieldName] = Me![NameOfFirstControlOnForm]
'repeat above lines moving to next field until done
MyRS.Update
MyRS.Close
MyDB.Close
End Function

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 
Back
Top