Hi,
I am working on some code that will check a combobox entry (category)against a table for duplicate entries. The code is working (with help from your colleagues) to display a msgbox that will redirect the user. But, no matter what I enter to redirect the focus and end the sub routine, I get either a 2108 or a 2115 error message. The code looks like this right now. What I want to do is display the message and refocus to a different tab control.
Private Sub category_beforeupdate(Cancel As Integer)
If DCount("*", "Operational Review Findings", "Client = '" & Me.Client & "' AND Category = '" & Me.Category & "'") > 0 Then
Category.BorderColor = vbRed
MsgBox "Duplicate Record - Select the Edit Findings tab to change input for this category."
Cancel = True
Me!Category = Null
Else
Category.BorderColor = vbBlack
End If
End Sub
How can I get this to work? You help is greatly appreciated
jketcher
I am working on some code that will check a combobox entry (category)against a table for duplicate entries. The code is working (with help from your colleagues) to display a msgbox that will redirect the user. But, no matter what I enter to redirect the focus and end the sub routine, I get either a 2108 or a 2115 error message. The code looks like this right now. What I want to do is display the message and refocus to a different tab control.
Private Sub category_beforeupdate(Cancel As Integer)
If DCount("*", "Operational Review Findings", "Client = '" & Me.Client & "' AND Category = '" & Me.Category & "'") > 0 Then
Category.BorderColor = vbRed
MsgBox "Duplicate Record - Select the Edit Findings tab to change input for this category."
Cancel = True
Me!Category = Null
Else
Category.BorderColor = vbBlack
End If
End Sub
How can I get this to work? You help is greatly appreciated
jketcher