R
Ran BD
guys i'm trying to use a not in list property to update a field called
Custname inside a comboBox
i'm using the folowing code and i'm geeting an error 91.
the debugger stops next to the line marked with -->
any idea ?
Private Sub CustNameCombo_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
strMsg = "'" & NewData & "' ?? ????? ?????? ?º???? " & vbCrLf & vbCrLf
strMsg = strMsg & "??? ?????? ?????? ?º?? ??? ??????"
strMsg = strMsg & vbCrLf & vbCrLf & "??? ?? YES ??????, ??? ?? NO ??????
??????."
If MsgBox(strMsg, vbQuestion + vbYesNo, "??? ?????? ???????") = vbNo
Then
Response = acDataErrContinue
Else
Set db = CurrentDb
---> Set rs = db.OpenRecordset("Cust_Tbl", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!AEName = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Custname inside a comboBox
i'm using the folowing code and i'm geeting an error 91.
the debugger stops next to the line marked with -->
any idea ?
Private Sub CustNameCombo_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
strMsg = "'" & NewData & "' ?? ????? ?????? ?º???? " & vbCrLf & vbCrLf
strMsg = strMsg & "??? ?????? ?????? ?º?? ??? ??????"
strMsg = strMsg & vbCrLf & vbCrLf & "??? ?? YES ??????, ??? ?? NO ??????
??????."
If MsgBox(strMsg, vbQuestion + vbYesNo, "??? ?????? ???????") = vbNo
Then
Response = acDataErrContinue
Else
Set db = CurrentDb
---> Set rs = db.OpenRecordset("Cust_Tbl", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!AEName = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub