Combobox entry not in RowSource problem

Skip Bisconer

Who Me?
Local time
Today, 02:34
Joined
Jan 22, 2008
Messages
285
I have a form updating table information with route and delivery information. From a combobox with the RowSource as the Order Number field in the table. The user is able to key in an order number, as he has it in hand, or select it from the from the list.

The problem is, if the user keys in an incorrect number or one that had not already been added to the table (we call them late orders) my process takes it all the way through as if it was a correct number. I need to set up a warning to the user to inform them that the number is not in the rowsource and then I can either return them to the combobox or, if it is a late order, to another form to add the data to the table. I have no idea how to accomplish this.

The following code here is the after update to the combobox I am using. Any help would be appreciated.

Private Sub Combo35_AfterUpdate()
On Error Resume Next
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[OEOO_ORDR] = " & Me.Combo35
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
'Have RouteID always retain the value of PegRoute
If Len(Me.RouteID & "") = 0 Then
Me.RouteID = Me.PegRoute
Me.DelDate = Me.PegDelDate
Combo35.Requery

End If


End Sub
 
Thanks Tiro worked like a charm
 

Users who are viewing this thread

Back
Top Bottom