Error trapping

AN60

Registered User.
Local time
Today, 16:10
Joined
Oct 25, 2003
Messages
283
One Off Error

I have the following in the after update event in a Combo bound to a tbl on a Main form;
Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[Vendor] = '" & Me![Combo8] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

The Combo gets its data from a table and I use the Not In List to add data which is not in the Tbl and of course Limit To List is set to Yes.
It works ok with one exception, when data is entered, but not saved, then deleted And the form closed. In this set of circumstances I get an error in the code above. Granted that normally a user will not delete data from the combo then exit the form but it does happen occasionally. I have tried adding On error goto.... but with no luck. Any suggestions?
 
Last edited:
Thanks Uncle G..
I have followed your suggestion and done some edits and have things under control (for the moment ...lol). I hadn't realised that unbound combo's can be a little different in error behaviour to combo's based on tbls or qrys when it comes to using NotInList. Small as it might be errors can cause fustration. I sorted it out by adding some better error handling code in the NotInList event (thanks go to Mile-O for this bit).
 

Users who are viewing this thread

Back
Top Bottom