Query criteria repeating

  • Thread starter Thread starter Blade370
  • Start date Start date
B

Blade370

I have created some queries that the user can use to search by adding certain
criteria. However after a few uses the users find that they are asked for the
same criteria twice before the query runs. Does anyone know the reason for
this?

Thanks.
 
You'll need to show us one of the queries that has this behavior. Open the
query in design view. Next go to View, SQL View and copy and past it here

Also are any forms involved?
 
SELECT [REGISTER LOG].TYPE, [REGISTER LOG].BLOCK, [REGISTER LOG].[BLOCK
REALIGNED], [REGISTER LOG].RECORD, [REGISTER LOG].SCHOOL, [REGISTER
LOG].[COURSE CODE], [REGISTER LOG].[CLASS CODE], [REGISTER LOG].[UNIT CODE],
[REGISTER LOG].SOC, [REGISTER LOG].ISSUED, [REGISTER LOG].RETURNED, [REGISTER
LOG].FILED, [REGISTER LOG].CLEARUP, [REGISTER LOG].CANCELLED, [REGISTER
LOG].DUPLICATE
FROM [REGISTER LOG]
WHERE ((([REGISTER LOG].BLOCK)=[Enter Required Block]) AND (([REGISTER
LOG].SCHOOL) Like [Enter School] & "*"))
ORDER BY [REGISTER LOG].[COURSE CODE];
 
Nothing real obvious, but here's a couple WAGS:

1. The SQL statement doesn't define the parameter. It should have something
like this in it:

PARAMETERS [Enter Required Block] Long, [Enter School] Text ( 255 );

I'm assuming that Enter Required Block is an integer and Enter School is text.

2. The word "TYPE" is reserved. Putting square brackets around it should
help. You can read more about reserved words at:
http://support.microsoft.com/kb/286335/

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Blade370 said:
SELECT [REGISTER LOG].TYPE, [REGISTER LOG].BLOCK, [REGISTER LOG].[BLOCK
REALIGNED], [REGISTER LOG].RECORD, [REGISTER LOG].SCHOOL, [REGISTER
LOG].[COURSE CODE], [REGISTER LOG].[CLASS CODE], [REGISTER LOG].[UNIT CODE],
[REGISTER LOG].SOC, [REGISTER LOG].ISSUED, [REGISTER LOG].RETURNED, [REGISTER
LOG].FILED, [REGISTER LOG].CLEARUP, [REGISTER LOG].CANCELLED, [REGISTER
LOG].DUPLICATE
FROM [REGISTER LOG]
WHERE ((([REGISTER LOG].BLOCK)=[Enter Required Block]) AND (([REGISTER
LOG].SCHOOL) Like [Enter School] & "*"))
ORDER BY [REGISTER LOG].[COURSE CODE];



Jerry Whittle said:
You'll need to show us one of the queries that has this behavior. Open the
query in design view. Next go to View, SQL View and copy and past it here

Also are any forms involved?
 
Hi Jerry,

I tried what you suggested but it has not cured the problem. I find if I
clear the search parameters from the query and then put them back in again
this cures the problem for a short while but then the problem starts again.
Thanks for your help with this.

Graeme

Jerry Whittle said:
Nothing real obvious, but here's a couple WAGS:

1. The SQL statement doesn't define the parameter. It should have something
like this in it:

PARAMETERS [Enter Required Block] Long, [Enter School] Text ( 255 );

I'm assuming that Enter Required Block is an integer and Enter School is text.

2. The word "TYPE" is reserved. Putting square brackets around it should
help. You can read more about reserved words at:
http://support.microsoft.com/kb/286335/

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Blade370 said:
SELECT [REGISTER LOG].TYPE, [REGISTER LOG].BLOCK, [REGISTER LOG].[BLOCK
REALIGNED], [REGISTER LOG].RECORD, [REGISTER LOG].SCHOOL, [REGISTER
LOG].[COURSE CODE], [REGISTER LOG].[CLASS CODE], [REGISTER LOG].[UNIT CODE],
[REGISTER LOG].SOC, [REGISTER LOG].ISSUED, [REGISTER LOG].RETURNED, [REGISTER
LOG].FILED, [REGISTER LOG].CLEARUP, [REGISTER LOG].CANCELLED, [REGISTER
LOG].DUPLICATE
FROM [REGISTER LOG]
WHERE ((([REGISTER LOG].BLOCK)=[Enter Required Block]) AND (([REGISTER
LOG].SCHOOL) Like [Enter School] & "*"))
ORDER BY [REGISTER LOG].[COURSE CODE];



Jerry Whittle said:
You'll need to show us one of the queries that has this behavior. Open the
query in design view. Next go to View, SQL View and copy and past it here

Also are any forms involved?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

:

I have created some queries that the user can use to search by adding certain
criteria. However after a few uses the users find that they are asked for the
same criteria twice before the query runs. Does anyone know the reason for
this?

Thanks.
 

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

Back
Top