help with two parameters query

  • Thread starter Thread starter Tony Dong
  • Start date Start date
T

Tony Dong

Hi there,

I wrote a query include two parameters, sometimes working fine, sometimes it
just take one parameter and give me error result, anyone know why and how to
solve this problem?

this is the query as follow

SELECT [tblCustomers].[CustomerID]
FROM tblCustomers
WHERE [tblCustomers].[Cus_LastName]=[?] And
[tblCustomers].[Cus_FirstName]=[?];

Thanks

Tony
 
Try giving the parameter for the Cus_FirstName a different name than for
Cus_LastName:

WHERE [tblCustomers].[Cus_LastName]=[Last Name ?] And
[tblCustomers].[Cus_FirstName]=[First Name ?];
 
Hi Lynn

Thanks a lot, it is works.
Tony Dong



Lynn Trapp said:
Try giving the parameter for the Cus_FirstName a different name than for
Cus_LastName:

WHERE [tblCustomers].[Cus_LastName]=[Last Name ?] And
[tblCustomers].[Cus_FirstName]=[First Name ?];

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm



Tony Dong said:
Hi there,

I wrote a query include two parameters, sometimes working fine,
sometimes
it
just take one parameter and give me error result, anyone know why and
how
to
solve this problem?

this is the query as follow

SELECT [tblCustomers].[CustomerID]
FROM tblCustomers
WHERE [tblCustomers].[Cus_LastName]=[?] And
[tblCustomers].[Cus_FirstName]=[?];

Thanks

Tony
 
That's great!

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm



Tony Dong said:
Hi Lynn

Thanks a lot, it is works.
Tony Dong



Lynn Trapp said:
Try giving the parameter for the Cus_FirstName a different name than for
Cus_LastName:

WHERE [tblCustomers].[Cus_LastName]=[Last Name ?] And
[tblCustomers].[Cus_FirstName]=[First Name ?];

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm



Tony Dong said:
Hi there,

I wrote a query include two parameters, sometimes working fine,
sometimes
it
just take one parameter and give me error result, anyone know why and
how
to
solve this problem?

this is the query as follow

SELECT [tblCustomers].[CustomerID]
FROM tblCustomers
WHERE [tblCustomers].[Cus_LastName]=[?] And
[tblCustomers].[Cus_FirstName]=[?];

Thanks

Tony
 
Back
Top