Query Parameters on a Form

G

Guest

I have a form that is used to enter the parameters for a query. I have it set
up with 3 unbound text boxes to enter the starting month number, the ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
J

John Spencer

I would try forcing the data type.

AND Month([Date Notified]) Between CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by using the query
grid and selecting parameters from the pop up menu for the query grid.
 
D

Dale Fye

Squirrel,

My guess is that the text boxes on your form are returning strings rather
than numbers. Why don't you use combo boxes instead? That way, you could
guarantee that the user will enter values within the range you want.

Try it like:

WHERE tblRMA.Customer = [Forms]![frmCustomerSelect]![CustomerSelect])
AND Year([Date Notified]) = Val([Forms]![frmCustomerSelect]![Text6])
AND Month([Date Notified]) Between
Val([Forms]![frmCustomerSelect]![Text2]) And
Val([Forms]![frmCustomerSelect]![Text4])
ORDER BY Year([Date Notified]), Month([Date Notified]);

HTH
Dale
 
G

Guest

Dale,
Is the way you have it set up with a combo box?

Dale Fye said:
Squirrel,

My guess is that the text boxes on your form are returning strings rather
than numbers. Why don't you use combo boxes instead? That way, you could
guarantee that the user will enter values within the range you want.

Try it like:

WHERE tblRMA.Customer = [Forms]![frmCustomerSelect]![CustomerSelect])
AND Year([Date Notified]) = Val([Forms]![frmCustomerSelect]![Text6])
AND Month([Date Notified]) Between
Val([Forms]![frmCustomerSelect]![Text2]) And
Val([Forms]![frmCustomerSelect]![Text4])
ORDER BY Year([Date Notified]), Month([Date Notified]);

HTH
Dale

Secret Squirrel said:
I have a form that is used to enter the parameters for a query. I have it
set
up with 3 unbound text boxes to enter the starting month number, the
ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and
ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
G

Guest

If I was to use the query parameters then it would prompt me to enter the
data along with the text boxes. Is there a way around this?

John Spencer said:
I would try forcing the data type.

AND Month([Date Notified]) Between CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by using the query
grid and selecting parameters from the pop up menu for the query grid.


Secret said:
I have a form that is used to enter the parameters for a query. I have it set
up with 3 unbound text boxes to enter the starting month number, the ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
J

John Spencer

The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret said:
If I was to use the query parameters then it would prompt me to enter the
data along with the text boxes. Is there a way around this?

John Spencer said:
I would try forcing the data type.

AND Month([Date Notified]) Between CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by using the query
grid and selecting parameters from the pop up menu for the query grid.


Secret said:
I have a form that is used to enter the parameters for a query. I have it set
up with 3 unbound text boxes to enter the starting month number, the ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
G

Guest

This didn't work either. Any other ideas?

Dale Fye said:
Squirrel,

My guess is that the text boxes on your form are returning strings rather
than numbers. Why don't you use combo boxes instead? That way, you could
guarantee that the user will enter values within the range you want.

Try it like:

WHERE tblRMA.Customer = [Forms]![frmCustomerSelect]![CustomerSelect])
AND Year([Date Notified]) = Val([Forms]![frmCustomerSelect]![Text6])
AND Month([Date Notified]) Between
Val([Forms]![frmCustomerSelect]![Text2]) And
Val([Forms]![frmCustomerSelect]![Text4])
ORDER BY Year([Date Notified]), Month([Date Notified]);

HTH
Dale

Secret Squirrel said:
I have a form that is used to enter the parameters for a query. I have it
set
up with 3 unbound text boxes to enter the starting month number, the
ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and
ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
G

Guest

That didn't work. It still did the same thing. Any other ideas?

John Spencer said:
The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret said:
If I was to use the query parameters then it would prompt me to enter the
data along with the text boxes. Is there a way around this?

John Spencer said:
I would try forcing the data type.

AND Month([Date Notified]) Between CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by using the query
grid and selecting parameters from the pop up menu for the query grid.


Secret Squirrel wrote:

I have a form that is used to enter the parameters for a query. I have it set
up with 3 unbound text boxes to enter the starting month number, the ending
month number, and the year. When I enter a month number greater than 9 it
won't show any data on the report. But when I enter any starting and ending
numbers between 1 & 9 the report works fine. Anyone have any idea why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
J

John Spencer

Not really.
Is the form open when you try to run the query?

Can you post the SQL text of your query?

At the beginning of the SQL statement you should have something like:
Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT ...
FROM ...
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

If this prompts you for
[Forms]![frmCustomerSelect]![Text2] and
[Forms]![frmCustomerSelect]![Text4]
then I would suspect that you either have the names of the controls
incorrect or the form is not open.

If this runs without the prompts, but gives you incorrect or no data, then I
would start looking at the data.

Secret Squirrel said:
That didn't work. It still did the same thing. Any other ideas?

John Spencer said:
The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret said:
If I was to use the query parameters then it would prompt me to enter
the
data along with the text boxes. Is there a way around this?

:

I would try forcing the data type.

AND Month([Date Notified]) Between
CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by
using the query
grid and selecting parameters from the pop up menu for the query
grid.


Secret Squirrel wrote:

I have a form that is used to enter the parameters for a query. I
have it set
up with 3 unbound text boxes to enter the starting month number,
the ending
month number, and the year. When I enter a month number greater
than 9 it
won't show any data on the report. But when I enter any starting
and ending
numbers between 1 & 9 the report works fine. Anyone have any idea
why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE
(((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between
[Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
G

Guest

Yes the form is opened when I run the query. The form is what triggers the
query. Here is the SQL text of the query;

SELECT tblRMA.Customer, tblRMA.RMA, tblRMA.SalesRep, tblRMA.[WO#-Line#],
tblRMA.[Date Notified], tblRMA.[Discrepant Qty], tblRMA.[U/M],
tblRMA.[Discrepancy Description], tblRMA.[Customer Expectation],
tblRMA.[Discrepancy Code], tblRMA.[Date Disposition Made],
tblRMA.[Disposition Code], tblRMA.[Credit Amount], tblRMA.[Raw Mat'l Cost],
tblRMA.[Labor Cost], tblRMA.[In / Out Frt Cost], tblRMA.[Misc Cost],
tblRMA.DateClosed, [Raw Mat'l Cost]+[Labor Cost]+[In / Out Frt Cost]+[Misc
Cost] AS [Total Cost], Year([Date Notified]) AS YearNum, Month([Date
Notified]) AS MonthNum
FROM tblRMA
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

John Spencer said:
Not really.
Is the form open when you try to run the query?

Can you post the SQL text of your query?

At the beginning of the SQL statement you should have something like:
Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT ...
FROM ...
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

If this prompts you for
[Forms]![frmCustomerSelect]![Text2] and
[Forms]![frmCustomerSelect]![Text4]
then I would suspect that you either have the names of the controls
incorrect or the form is not open.

If this runs without the prompts, but gives you incorrect or no data, then I
would start looking at the data.

Secret Squirrel said:
That didn't work. It still did the same thing. Any other ideas?

John Spencer said:
The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret Squirrel wrote:

If I was to use the query parameters then it would prompt me to enter
the
data along with the text boxes. Is there a way around this?

:

I would try forcing the data type.

AND Month([Date Notified]) Between
CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by
using the query
grid and selecting parameters from the pop up menu for the query
grid.


Secret Squirrel wrote:

I have a form that is used to enter the parameters for a query. I
have it set
up with 3 unbound text boxes to enter the starting month number,
the ending
month number, and the year. When I enter a month number greater
than 9 it
won't show any data on the report. But when I enter any starting
and ending
numbers between 1 & 9 the report works fine. Anyone have any idea
why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE
(((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between
[Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
J

John Spencer

The SQL you posted has none of the modifications that have been suggested to
you. The following should work - have you tried this variation? IF so,
what happens? Error message, no records returned, wrong records returned,
parameter box requesting input?

Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT tblRMA.Customer, tblRMA.RMA, tblRMA.SalesRep, tblRMA.[WO#-Line#],
tblRMA.[Date Notified], tblRMA.[Discrepant Qty], tblRMA.[U/M],
tblRMA.[Discrepancy Description], tblRMA.[Customer Expectation],
tblRMA.[Discrepancy Code], tblRMA.[Date Disposition Made],
tblRMA.[Disposition Code], tblRMA.[Credit Amount], tblRMA.[Raw Mat'l Cost],
tblRMA.[Labor Cost], tblRMA.[In / Out Frt Cost], tblRMA.[Misc Cost],
tblRMA.DateClosed, [Raw Mat'l Cost]+[Labor Cost]+[In / Out Frt Cost]+[Misc
Cost] AS [Total Cost], Year([Date Notified]) AS YearNum, Month([Date
Notified]) AS MonthNum
FROM tblRMA
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);


Secret Squirrel said:
Yes the form is opened when I run the query. The form is what triggers the
query. Here is the SQL text of the query;

SELECT tblRMA.Customer, tblRMA.RMA, tblRMA.SalesRep, tblRMA.[WO#-Line#],
tblRMA.[Date Notified], tblRMA.[Discrepant Qty], tblRMA.[U/M],
tblRMA.[Discrepancy Description], tblRMA.[Customer Expectation],
tblRMA.[Discrepancy Code], tblRMA.[Date Disposition Made],
tblRMA.[Disposition Code], tblRMA.[Credit Amount], tblRMA.[Raw Mat'l
Cost],
tblRMA.[Labor Cost], tblRMA.[In / Out Frt Cost], tblRMA.[Misc Cost],
tblRMA.DateClosed, [Raw Mat'l Cost]+[Labor Cost]+[In / Out Frt Cost]+[Misc
Cost] AS [Total Cost], Year([Date Notified]) AS YearNum, Month([Date
Notified]) AS MonthNum
FROM tblRMA
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

John Spencer said:
Not really.
Is the form open when you try to run the query?

Can you post the SQL text of your query?

At the beginning of the SQL statement you should have something like:
Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT ...
FROM ...
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

If this prompts you for
[Forms]![frmCustomerSelect]![Text2] and
[Forms]![frmCustomerSelect]![Text4]
then I would suspect that you either have the names of the controls
incorrect or the form is not open.

If this runs without the prompts, but gives you incorrect or no data,
then I
would start looking at the data.

Secret Squirrel said:
That didn't work. It still did the same thing. Any other ideas?

:

The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret Squirrel wrote:

If I was to use the query parameters then it would prompt me to
enter
the
data along with the text boxes. Is there a way around this?

:

I would try forcing the data type.

AND Month([Date Notified]) Between
CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by
using the query
grid and selecting parameters from the pop up menu for the query
grid.


Secret Squirrel wrote:

I have a form that is used to enter the parameters for a query.
I
have it set
up with 3 unbound text boxes to enter the starting month number,
the ending
month number, and the year. When I enter a month number greater
than 9 it
won't show any data on the report. But when I enter any starting
and ending
numbers between 1 & 9 the report works fine. Anyone have any
idea
why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE
(((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6])
AND
((Month([Date Notified])) Between
[Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 
G

Guest

I wanted to show you the original text of the SQL. I did put the code in the
way you wrote it and it works fine now. No problems whatsoever. Thank you
very much for your help John! Happy Turkey Day!

John Spencer said:
The SQL you posted has none of the modifications that have been suggested to
you. The following should work - have you tried this variation? IF so,
what happens? Error message, no records returned, wrong records returned,
parameter box requesting input?

Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT tblRMA.Customer, tblRMA.RMA, tblRMA.SalesRep, tblRMA.[WO#-Line#],
tblRMA.[Date Notified], tblRMA.[Discrepant Qty], tblRMA.[U/M],
tblRMA.[Discrepancy Description], tblRMA.[Customer Expectation],
tblRMA.[Discrepancy Code], tblRMA.[Date Disposition Made],
tblRMA.[Disposition Code], tblRMA.[Credit Amount], tblRMA.[Raw Mat'l Cost],
tblRMA.[Labor Cost], tblRMA.[In / Out Frt Cost], tblRMA.[Misc Cost],
tblRMA.DateClosed, [Raw Mat'l Cost]+[Labor Cost]+[In / Out Frt Cost]+[Misc
Cost] AS [Total Cost], Year([Date Notified]) AS YearNum, Month([Date
Notified]) AS MonthNum
FROM tblRMA
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect]) AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);


Secret Squirrel said:
Yes the form is opened when I run the query. The form is what triggers the
query. Here is the SQL text of the query;

SELECT tblRMA.Customer, tblRMA.RMA, tblRMA.SalesRep, tblRMA.[WO#-Line#],
tblRMA.[Date Notified], tblRMA.[Discrepant Qty], tblRMA.[U/M],
tblRMA.[Discrepancy Description], tblRMA.[Customer Expectation],
tblRMA.[Discrepancy Code], tblRMA.[Date Disposition Made],
tblRMA.[Disposition Code], tblRMA.[Credit Amount], tblRMA.[Raw Mat'l
Cost],
tblRMA.[Labor Cost], tblRMA.[In / Out Frt Cost], tblRMA.[Misc Cost],
tblRMA.DateClosed, [Raw Mat'l Cost]+[Labor Cost]+[In / Out Frt Cost]+[Misc
Cost] AS [Total Cost], Year([Date Notified]) AS YearNum, Month([Date
Notified]) AS MonthNum
FROM tblRMA
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

John Spencer said:
Not really.
Is the form open when you try to run the query?

Can you post the SQL text of your query?

At the beginning of the SQL statement you should have something like:
Parameters [Forms]![frmCustomerSelect]![Text2] Long,
[Forms]![frmCustomerSelect]![Text4] Long;
SELECT ...
FROM ...
WHERE (((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6]) AND
((Month([Date Notified])) Between [Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);

If this prompts you for
[Forms]![frmCustomerSelect]![Text2] and
[Forms]![frmCustomerSelect]![Text4]
then I would suspect that you either have the names of the controls
incorrect or the form is not open.

If this runs without the prompts, but gives you incorrect or no data,
then I
would start looking at the data.

message That didn't work. It still did the same thing. Any other ideas?

:

The parameters you enter are
[Forms]![frmCustomerSelect]![Text2]
and
[Forms]![frmCustomerSelect]![Text4]


Secret Squirrel wrote:

If I was to use the query parameters then it would prompt me to
enter
the
data along with the text boxes. Is there a way around this?

:

I would try forcing the data type.

AND Month([Date Notified]) Between
CLng([Forms]![frmCustomerSelect]![Text2]) And
CLng([Forms]![frmCustomerSelect]![Text4])

You can also set the parameter type either in the SQL Text or by
using the query
grid and selecting parameters from the pop up menu for the query
grid.


Secret Squirrel wrote:

I have a form that is used to enter the parameters for a query.
I
have it set
up with 3 unbound text boxes to enter the starting month number,
the ending
month number, and the year. When I enter a month number greater
than 9 it
won't show any data on the report. But when I enter any starting
and ending
numbers between 1 & 9 the report works fine. Anyone have any
idea
why it
won't work with 10 thru 12? Here is what I have in my query;

WHERE
(((tblRMA.Customer)=[Forms]![frmCustomerSelect]![CustomerSelect])
AND
((Year([Date Notified]))=[Forms]![frmCustomerSelect]![Text6])
AND
((Month([Date Notified])) Between
[Forms]![frmCustomerSelect]![Text2] And
[Forms]![frmCustomerSelect]![Text4]))
ORDER BY Year([Date Notified]), Month([Date Notified]);
 

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