Filter by selection: Type mismatch in expression

R

Ricter

When I try to use the filter by selection function on any field in a
mainform, I'm getting the "Type mismatch in expression" error. The main form
contains three subforms and a few calculated controls, but I'm only
attempting to filter on uncalculated fields in the main form.

I don't see this basic problem in a search of General, Forms, or Forms -
Coding...
 
A

Allen Browne

We need to determine whether the error results from the attempt to filter,
or the values in the calculated controls once the filter is applied.

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database to get rid of this junk:
Tools | Database Utilities | Compact
Test that the problem still exists.

2. Select your form on the Forms tab of the Database Window.
Copy (Ctrl+C) and Paste (Ctrl+V), and supply a new name for this copy of
your form.
(We are working on a copy so your original form is preserved.)

3. Open this copy in design view, and delete all the calculated controls.
Save.

4. Test: Is the problem gone?
4.1 Yes: The issue is with the calculations in the calculated controls.
Typecast the expressions, as explained here:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

4.2 No : If the problem is still present, delete the subforms from this
copy. Continue to divide'n'conquor until you pinpoint where the issue lies.
 
R

Ricter

Holy cow, awesome reply Allen, thanks. Cut and paste I hope. :)

Ok, performed routine #1 as above, and the problem is solved for all
controls on the main form except for the comboboxes. Should I move on to
routine #2, or will the comboboxes require another solution?

Rick
 
A

Allen Browne

Examine the RowSource of the combos, and their Bound Column property. That
could cause the confusion.

If not, the other steps are worth persuing.

(The answer was not really a cut'n'paste job, even though #1 is standard
fare.)
 

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