You don't need to reference your access form into SQL Server to create new records from
your form's textboxes. Please Link your SS Table in MS Access and Write Code to Insert a
new record from your Form into SS.
Since you haven't provided any detail, here is a sample code you need to write. I am assuming that
you have an average level of VBA programming knowledge.
Lets say you are adding a new customer in Customer Table which is linked from Sql Server.
Please Write code under Click event of your SAVE button on the form FrmCustomer. The purpose is
when user click save button then all the values from Textboxes to your SQL Server Customer Table.
- Customer Table has FirstName and LastName Columns
- FrmCustomer has TxtFirstName and TxtLastName Textboxes
Dim RsCustomer as Recordset
Set RsCustomer = Currentdb.openrecordset("Select * from Customer")
RsCustomer.Addnew
RsCustomer!FirstName = FrmCustomer!TxtFirstName.Value
RsCustomer!LastName = FrmCustomer!TxtLAstName.Value
RsCustomer.Update
There are few things you need to do :
- Open recordset as dynaset
- Have a primary key to your SS table and identify when link table in Access
Above two steps makes your table writable otherwise it will open as a snapshot/readonly.