I have a combobox called cmbTitle. If a user enters a title not in the box, I want them to have the option of opening a form to add the title or canceling the action.
Here is the code I have running:
Private Sub cmbTitle_NotInList(NewData As String, response As Integer)
Dim msg As String
Dim Title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "The title you are entering is not in the list." & vbCrLf & _
"Do you wish to enter it now?"
style = MsgBoxStyle.YesNo
Title = "Add Title"
response = MsgBox(msg, style, Title)
If response = MsgBoxResult.Yes Then
DoCmd.OpenForm "frmNewTitle", acNormal
End If
End Sub
For some reason I keep getting a "user-defined type not defined" error. I have had this problem in the past with other databases and fixed it by adding references. Any suggestions?
Here is the code I have running:
Private Sub cmbTitle_NotInList(NewData As String, response As Integer)
Dim msg As String
Dim Title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
msg = "The title you are entering is not in the list." & vbCrLf & _
"Do you wish to enter it now?"
style = MsgBoxStyle.YesNo
Title = "Add Title"
response = MsgBox(msg, style, Title)
If response = MsgBoxResult.Yes Then
DoCmd.OpenForm "frmNewTitle", acNormal
End If
End Sub
For some reason I keep getting a "user-defined type not defined" error. I have had this problem in the past with other databases and fixed it by adding references. Any suggestions?