Access 97
combo box is on a continuous form.
In one of my combo boxes I have code in the key down event, which works fine
except in one case and that's when a user types data that is not on the
list. I have code that takes them to a separate form to add the new data,
which that works fine also. My problem is that the On Not In List and Key
Down both try to fire. Could someone help me with a way to stop the On Key
Down event from firing if the On Not In List is firing?
Below is the code in the On Key Down and where it pukes is the
Me.cmdClose.SetFocus. Error message says that it can not move the focus to
cmdClose
Code behind On Key Down:
If Me.NewRecord Then
If KeyCode = 9 Then
Me.cmdClose.SetFocus
End If
Else
If KeyCode = 9 Then
Dim recClone As Recordset
Set recClone = Me.RecordsetClone()
recClone.Bookmark = Me.Bookmark
If recClone.EOF Then
Me.cmdClose.SetFocus
Else
DoCmd.GoToRecord acActiveDataObject, , acNext
End If
recClone.Close
End If
End If
TIA
Shane
combo box is on a continuous form.
In one of my combo boxes I have code in the key down event, which works fine
except in one case and that's when a user types data that is not on the
list. I have code that takes them to a separate form to add the new data,
which that works fine also. My problem is that the On Not In List and Key
Down both try to fire. Could someone help me with a way to stop the On Key
Down event from firing if the On Not In List is firing?
Below is the code in the On Key Down and where it pukes is the
Me.cmdClose.SetFocus. Error message says that it can not move the focus to
cmdClose
Code behind On Key Down:
If Me.NewRecord Then
If KeyCode = 9 Then
Me.cmdClose.SetFocus
End If
Else
If KeyCode = 9 Then
Dim recClone As Recordset
Set recClone = Me.RecordsetClone()
recClone.Bookmark = Me.Bookmark
If recClone.EOF Then
Me.cmdClose.SetFocus
Else
DoCmd.GoToRecord acActiveDataObject, , acNext
End If
recClone.Close
End If
End If
TIA
Shane