F
Frustrated
I keep getting a "run-time error 13" when I run the following code, used to
update my table on the notinlist properity.
Dim DB As Database
Dim RS As Recordset
Dim Msg As String
Dim CR As String: CR = Chr$(13)
If NewData = "" Then Exit Sub
Msg = MsgBox("'" & NewData & "' is not in the list." & CR & CR & _
"Do you want to add it?", vbYesNo, "New Steel Size
Message")
If Msg = vbYes Then
Set DB = DBEngine.Workspaces(0).Databases(0)
Set RS = DB.OpenRecordset("tblSteelSize")
RS.AddNew
RS![SteelSize] = NewData
RS.Update
If Err Then
Response = DATA_ERRCONTINUE
Beep: MsgBox Error$, 48
MsgBox "Please try again."
Else
Response = DATA_ERRADDED
End If
End If
End Sub
Am I missing something? In my eyes this should work
Thanks
Mark
update my table on the notinlist properity.
Dim DB As Database
Dim RS As Recordset
Dim Msg As String
Dim CR As String: CR = Chr$(13)
If NewData = "" Then Exit Sub
Msg = MsgBox("'" & NewData & "' is not in the list." & CR & CR & _
"Do you want to add it?", vbYesNo, "New Steel Size
Message")
If Msg = vbYes Then
Set DB = DBEngine.Workspaces(0).Databases(0)
Set RS = DB.OpenRecordset("tblSteelSize")
RS.AddNew
RS![SteelSize] = NewData
RS.Update
If Err Then
Response = DATA_ERRCONTINUE
Beep: MsgBox Error$, 48
MsgBox "Please try again."
Else
Response = DATA_ERRADDED
End If
End If
End Sub
Am I missing something? In my eyes this should work
Thanks
Mark