G
Guest
I am attempting to update fields in a table with data selected on a form from
a combo box. The code compiles without error but, it does not update the
table with the information. Below is the code I am using to attempt to update
the table.
Private Sub UpDateSingleRecord_Click()
On Error GoTo Err_UpDateSingleRecord_Click
Dim InstSmt As String
Dim SelSmt As String
InstSmt = "INSERT INTO Student_Info (LAST_NAME) VALUES(
Forms![Student_info1]![LAST_NAME] )"
'SelSmt = "SELECT [Forms]![Student_info1]![LAST_NAME] FROM
[Forms]![Student_info1] WHERE LAST_NAME = '" & LName & "';"
DoCmd.GoToRecord , , acNewRec
Exit_UpDateSingleRecord_Click:
Exit Sub
Err_UpDateSingleRecord_Click:
MsgBox Err.Description
Resume Exit_UpDateSingleRecord_Click
End Sub
A connection to the table is estabilished OnClick on the combo box. This
connection is closed before Sub Onclick ends. Do I need to establish another
connection N the save record sub?
a combo box. The code compiles without error but, it does not update the
table with the information. Below is the code I am using to attempt to update
the table.
Private Sub UpDateSingleRecord_Click()
On Error GoTo Err_UpDateSingleRecord_Click
Dim InstSmt As String
Dim SelSmt As String
InstSmt = "INSERT INTO Student_Info (LAST_NAME) VALUES(
Forms![Student_info1]![LAST_NAME] )"
'SelSmt = "SELECT [Forms]![Student_info1]![LAST_NAME] FROM
[Forms]![Student_info1] WHERE LAST_NAME = '" & LName & "';"
DoCmd.GoToRecord , , acNewRec
Exit_UpDateSingleRecord_Click:
Exit Sub
Err_UpDateSingleRecord_Click:
MsgBox Err.Description
Resume Exit_UpDateSingleRecord_Click
End Sub
A connection to the table is estabilished OnClick on the combo box. This
connection is closed before Sub Onclick ends. Do I need to establish another
connection N the save record sub?