Type Mismatch with Option Group

Discussion in 'Access Macros' started by Steve, May 19, 2010.

  1. Steve

    Steve Guest

    I am using Access 2007 on a Windows 7 machine.
    I have an unbound form named frmChoose_Reports to select reports to print.
    This form has two option groups named ReportSelctor and ReportType.
    ReportSelector contains 11 option buttons to select the desired report and
    ReportType contains 3 option buttons to select whether the report is
    displayed in a datasheet, pivot chart or pivot table view. A Print button
    activates a macro.

    The macro has conditional statements that check the values of the option
    groups to print the desired report in the proper format. The conditional
    statement format is:

    [Forms]![frmChoose_Reports]![ReportSelector]=1 And

    If the condition is satisfied, a query is executed. I have a conditional
    check for each possible combination of values in the two option groups.

    When an option is selected the macro begins and I get a “Type Mismatch†error.

    Any suggestions?
    Steve, May 19, 2010
    1. Advertisements

  2. Steve,

    Off on a tangent, since the command button is already on the form, you don't
    need to show the form, in other words you would be better using this as your
    Condition expression:
    [ReportSelector]=1 And [ReportType]=1

    I would suspect the Type Mismatch error is unrelated to your macro
    Condition. I think it is coming from somewhere else, such as a criteria in
    the query that the report is based on, or a calculated expression in the
    query or report.

    Does the report open without error if you try to run it directly?

    Perhaps you could copy/paste the SQL view of the query that the report is
    based on, into your reply here, and someone may be able to spot whether
    there is a problem there.
    Steve Schapel, May 19, 2010
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.