help with two parameters query

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
 
L

Lynn Trapp

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 ?];
 
T

Tony Dong

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
 
L

Lynn Trapp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top