FahadTiger
Member
- Local time
- Today, 19:10
- Joined
- Jun 20, 2021
- Messages
- 115
Hi Experts..
i used the below code for entering new record inside combobox..if i choose yes from popup message its fine
but when i choose NO..display popup message (the text you Entered isnt an item in the list)!!
How can i prevent display this message?
thank you all
----------------------
Private Sub DoctorID_NotInList(NewData As String, Response As Integer)
Dim strTmp As String
strTmp = "Add '" & NewData & "' as a new doctor?"
If MsgBox(strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then
strTmp = "INSERT INTO doctors ( DoctorName ) " & _
"SELECT """ & NewData & """ AS DoctorName;"
DBEngine(0)(0).Execute strTmp, dbFailOnError
Response = acDataErrAdded
End If
End Sub
i used the below code for entering new record inside combobox..if i choose yes from popup message its fine
but when i choose NO..display popup message (the text you Entered isnt an item in the list)!!
How can i prevent display this message?
thank you all
----------------------
Private Sub DoctorID_NotInList(NewData As String, Response As Integer)
Dim strTmp As String
strTmp = "Add '" & NewData & "' as a new doctor?"
If MsgBox(strTmp, vbYesNo + vbDefaultButton2 + vbQuestion, "Not in list") = vbYes Then
strTmp = "INSERT INTO doctors ( DoctorName ) " & _
"SELECT """ & NewData & """ AS DoctorName;"
DBEngine(0)(0).Execute strTmp, dbFailOnError
Response = acDataErrAdded
End If
End Sub