Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Filter by selection: Type mismatch in expression

Discussion in 'Information Technology' started by Ricter, Jul 28, 2006.

  1. Ricter

    Ricter
    Expand Collapse
    Guest

    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...
     
  2. Loading...

    Similar Threads Forum Date
    General Filter Test Hard Talk May 20, 2008
    General Gurdwara Management Seva : Election By Majority Vote Vs Unanimous Selection by Gurmatta Hard Talk Feb 21, 2013
    India Why Selection System is Better than Election System in Running the Sikh Gurudwaras Breaking News Feb 1, 2013
    Christianity Catholic Saint Selection: It's Complicated Interfaith Dialogues May 1, 2011
    Akal Takht annuls selection of priests: Battlelines drawn ! Hard Talk Sep 9, 2006

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    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.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.
    "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    news:A428305B-F6AB-4A9D-BD7A-8AA32ADF565E@microsoft.com...
    > 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...
     
  4. Ricter

    Ricter
    Expand Collapse
    Guest

    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


    "Allen Browne" wrote:

    > 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.
    >
    > --
    > Allen Browne - Microsoft MVP. Perth, Western Australia.
    > Tips for Access users - http://allenbrowne.com/tips.html
    > Reply to group, rather than allenbrowne at mvps dot org.
    > "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    > news:A428305B-F6AB-4A9D-BD7A-8AA32ADF565E@microsoft.com...
    > > 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...

    >
    >
    >
     
  5. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    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.)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    news:F0D8DADC-58D5-4F1F-BBB6-6CFA7F0B8E2B@microsoft.com...
    > 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
    >
    >
    > "Allen Browne" wrote:
    >
    >> 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.
    >>
    >> "Ricter" <Ricter@discussions.microsoft.com> wrote in message
    >> news:A428305B-F6AB-4A9D-BD7A-8AA32ADF565E@microsoft.com...
    >> > 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...
     

Share This Page