Hello,
I have the NotInList code on a combo box (see below):
I'm getting the error message -
"You must use the dbSeeChanges option w/OpenRecordset when
accessing a SQL Server table w/an identity column".
If anyone has seen this message before and can point me in the right direction it would be greatly appreciated. Thanks in advance.
Private Sub cboStudentJobTitle_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
Dim db As Database
Dim rst As Recordset
strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"
If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "Add new job title to the list?") Then
Response = acDataErrDisplay
Else
Set db = CurrentDb()
Set rst = db.OpenRecordset("OccupationCodes", dbSeeChanges)
rst.AddNew
rst!OccupationTitle = NewData
rst.Update
Response = acDataErrAdded
rst.Close
End If
End Sub
I have the NotInList code on a combo box (see below):
I'm getting the error message -
"You must use the dbSeeChanges option w/OpenRecordset when
accessing a SQL Server table w/an identity column".
If anyone has seen this message before and can point me in the right direction it would be greatly appreciated. Thanks in advance.
Private Sub cboStudentJobTitle_NotInList(NewData As String, Response As Integer)
Dim strMsg As String
Dim db As Database
Dim rst As Recordset
strMsg = "'" & NewData & "' is not in the list. "
strMsg = strMsg & "Would you like to add it?"
If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "Add new job title to the list?") Then
Response = acDataErrDisplay
Else
Set db = CurrentDb()
Set rst = db.OpenRecordset("OccupationCodes", dbSeeChanges)
rst.AddNew
rst!OccupationTitle = NewData
rst.Update
Response = acDataErrAdded
rst.Close
End If
End Sub