I am trying to create a form that allows the user to search (Access database) for a record by last name or customer number. It can be a partial last name or customer number.
The SQL statement and code are below. This is the same method used successfully for a SQL Server database, but it is not working with Access. The error message I am receiving is "Argument not specified for parameter 'Customer_Number' of 'Public Overridalbe Overloads Function Fill(dataTable As FindAccountDataSet.CustomerAccountsDataTable, Last_Name As String, Customer_Number As Integer) As Integer".
Can someone explain how to correct?
SELECT [Customer Number], [Last Name], [First Name], Address, City, State, [ZIP Code], [Telephone Number], [Account Balance], [Date Last Payment]
FROM CustomerAccounts
WHERE ([Last Name] LIKE ?) OR ([Customer Number] LIKE ?)
Note: I have tried using the astericks and percentage symbols as well.
Private Sub btnSearchLastName_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearchLastName.Click
'Search by last name
Me.CustomerAccountsTableAdapter.Fill(Me.FindAccountDataSet.CustomerAccounts, txtLastName.Text)
End Sub
Private Sub btnSearchCustomerNum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearchCustomerNum.Click
'Search by customer number
Me.CustomerAccountsTableAdapter.Fill(Me.FindAccountDataSet.CustomerAccounts, txtAccountNum.Text)
End Sub