I am using the code
Private Sub cmdNew_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("select * from Incident")
rst.AddNew
rst!IncidentID = txtId
rst!IncidentDate = txtDate
rst!ArrestMade = comArrest
rst!CID170FormHandedIn = comCID170
rst!OffenderID = frmOffender.CurrentRecord(OffenderID)
rst!VictimID = frmVictim.CurrentRecord(VictimID)
rst!CollarNum = frmOfficer.txtCollarNumber
rst.Update
rst.Close
MsgBox ("Incident added to system.")
DoCmd.Close
End Sub
to save a record but I keep getting run time error 424 Object need refering to this line
rst!OffenderID = frmOffender.CurrentRecord(OffenderID)
Can anyone help
Private Sub cmdNew_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("select * from Incident")
rst.AddNew
rst!IncidentID = txtId
rst!IncidentDate = txtDate
rst!ArrestMade = comArrest
rst!CID170FormHandedIn = comCID170
rst!OffenderID = frmOffender.CurrentRecord(OffenderID)
rst!VictimID = frmVictim.CurrentRecord(VictimID)
rst!CollarNum = frmOfficer.txtCollarNumber
rst.Update
rst.Close
MsgBox ("Incident added to system.")
DoCmd.Close
End Sub
to save a record but I keep getting run time error 424 Object need refering to this line
rst!OffenderID = frmOffender.CurrentRecord(OffenderID)
Can anyone help