J
jon
Hi All
I am trying to add a record to a table from information on a form.
The Table is called SRSValue
The form is called Form_SRS_Input
The 2 field on the form I want to save are called.
SRSValue
FrmCount_Temp
And I want to save them to the fields
SRS_Val
LinkToTemp
The code I have now is messed up with me trying and failing to get it to
work ( but it is below).
Thanks
Jon
Private Sub ButSrsAdd_Click()
On Error GoTo Err_ButSrsAdd_Click
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
rst.Open "srs_input", , , , ' *** don't know what to put here***
With rst
.AddNew
[SRSValue]![LinktoTemp] = Me![FrmCount_Temp]
[SRSValue]![SRS_Val] = Me![SRSValue]
.Update
.Close
End With
Exit_ButSrsAdd_Click:
Exit Sub
Err_ButSrsAdd_Click:
MsgBox Err.Description
Resume Exit_ButSrsAdd_Click
End Sub
I am trying to add a record to a table from information on a form.
The Table is called SRSValue
The form is called Form_SRS_Input
The 2 field on the form I want to save are called.
SRSValue
FrmCount_Temp
And I want to save them to the fields
SRS_Val
LinkToTemp
The code I have now is messed up with me trying and failing to get it to
work ( but it is below).
Thanks
Jon
Private Sub ButSrsAdd_Click()
On Error GoTo Err_ButSrsAdd_Click
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
rst.Open "srs_input", , , , ' *** don't know what to put here***
With rst
.AddNew
[SRSValue]![LinktoTemp] = Me![FrmCount_Temp]
[SRSValue]![SRS_Val] = Me![SRSValue]
.Update
.Close
End With
Exit_ButSrsAdd_Click:
Exit Sub
Err_ButSrsAdd_Click:
MsgBox Err.Description
Resume Exit_ButSrsAdd_Click
End Sub