How to find a customer and go to a new order number.
I have a Form called frmOrders. for issuing orders and invoices. How can i find a customer from a
combo box, and then issue a new order with this customer? I have a form called frmCustomers, and
there i use the followin expresion to find the customer:
Private Sub CboCompany_AfterUpdate()
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.FindFirst “[ClientID] = ” & CboCompany.Value
If rs.NoMatch Then
MsgBox “Client Not Found”
Else
Me.Bookmark = rs.Bookmark
End If
End Sub
It works excellent.This code is very convenient because the client appears after i write one or two
letters. However i cannot use this code in the form frmOrders.The form frmOrders has a different
recordset, based on the OrderID. This codes finds only the first customer,a customer only with an
existent order. And i want to go to a new orderid.If i use the expression DoCmd.GoToRecord , ,
acNewRec, then the customer chosen disappears.What i want is to choose a customer from a combo box
and then go to a new order.The source of my mistake is that i want to go to anew record fr an
order, and not a new record for a new customer. My database is similar to that of Northwind traders
shipped with Microsoft.
Will be grateful for any help