Recordset.find fetching first record..my ID and StrCustomer data type are auto number

CFO PIDC 21 Reputation points
2022-06-03T09:51:41.497+00:00

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
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
729 questions
{count} votes