Recordset.find fetching first record..my ID and StrCustomer data type are auto number
CFO PIDC
21
Reputation points
Private Sub LoadCustomer(strCustomerID As String)
' This will retrieve the customer info and populate the data on the form. Note that
' the recordset is immediately closed once the info is retrieved.
Dim rs_customer As ADODB.Recordset
On Error GoTo Err_LoadCustomer
Set cnn = CurrentProject.Connection
Set rs_customer = New ADODB.Recordset
rs_customer.Find "ID = '" & strCustomerID & "'"
Debug.Print ID, textf, numf, datef
If rs_customer.EOF Then
Beep
MsgBox "Customer record not found. CustomerID = " & strCustomerID
GoTo Exit_LoadCustomer
End If
With rs_customer
CompanyName = !textf
'textf = !CompanyName
ContactName = !numf
'ContactTitle = !ContactTitle
'Address = !Address
City = !datef
'Region = !Region
'PostalCode = !PostalCode
'Country = !Country
'Phone = !Phone
'Fax = !Fax
End With