Cannot filter by only one control on form.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query populating a continuous form. I have one control (containing
a text month year like 'Dec 05'). Filter by Selection works on every other
control - text or numbers, but when a value is selected in this field, no
records are returned.
Any ideas?
 
What version of Access is this? (Access 2000 works differently than 2002 or
2003 with lookup filters.)

This field comes from the query, which gets it from a table.
Open the table in design view.
What is the Data Type of this field?

If is is a Date/Time field, you will need to supply the date range in the
form's filter rather than merely a text version of the month.

If the value is displayed in a combo box (not a text box), you need to
supply the value that matches the bound column of the combo.

If it is a Text field, ask Access what is in the field.
Press Ctrl+G to open the Immediate window.
Enter something like this while the form is showing the value you want to
filter on:
? Forms![Form1]![MyDate]
where Form1 represents the name of your form, and MyDate the name of your
control.

Then ask Access to show you how the form is filtered (while it returns no
records):
? Forms![Form1].Filter

Can you see a reason why these 2 things don't match?
 
Allen,
This is Access 2003.
The field is text and populated via a combo box with a totals query that
takes dates and converts them to a MMM YY format using date(format, date,
"mmm yy").
The data source and combo box name are the same as the table name for the
field.
The filter returns no records if I choose filter by selection or filter by
form choose a valid filter by form combo box value.
This did work in December. I may have installed current Office updates since.
Thanks for your response. I will provide information on the Immediates
value over the weekend.
--
Particularly puzzled

Allen Browne said:
What version of Access is this? (Access 2000 works differently than 2002 or
2003 with lookup filters.)

This field comes from the query, which gets it from a table.
Open the table in design view.
What is the Data Type of this field?

If is is a Date/Time field, you will need to supply the date range in the
form's filter rather than merely a text version of the month.

If the value is displayed in a combo box (not a text box), you need to
supply the value that matches the bound column of the combo.

If it is a Text field, ask Access what is in the field.
Press Ctrl+G to open the Immediate window.
Enter something like this while the form is showing the value you want to
filter on:
? Forms![Form1]![MyDate]
where Form1 represents the name of your form, and MyDate the name of your
control.

Then ask Access to show you how the form is filtered (while it returns no
records):
? Forms![Form1].Filter

Can you see a reason why these 2 things don't match?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Dick D said:
I have a query populating a continuous form. I have one control
(containing
a text month year like 'Dec 05'). Filter by Selection works on every
other
control - text or numbers, but when a value is selected in this field, no
records are returned.
Any ideas?
 
Back
Top