I am trying to insert data from a form to antother table in VBA and would like to do this without using a macro. I have got the following code but it doesn't work. Can anyone help me????
Dim appointmentdate As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strsql As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbl date", dbOpenDynaset)
appointmentdate = Me.Appointment_Date
Set rst = db.OpenRecordset("INSERT INTO tbldate ( appointmentdate) VALUES (" & appointmentdate & ")")
Dim appointmentdate As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strsql As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbl date", dbOpenDynaset)
appointmentdate = Me.Appointment_Date
Set rst = db.OpenRecordset("INSERT INTO tbldate ( appointmentdate) VALUES (" & appointmentdate & ")")