From: Steve on 18 May 2010 17:24 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 [Forms]![frmChoose_Reports]![ReportType]=1 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?
From: tony on 19 May 2010 06:39 On 18 May, 22:24, Steve <St...(a)discussions.microsoft.com> wrote: > 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 > [Forms]![frmChoose_Reports]![ReportType]=1 > > 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? Hi Steve, Option buttons only return a value of 0 or -1 not 1 as per your test I don't think your Type Mismatch error is anything to do with you option button test, I think it's probably the query(s) that is being run as a result and bet that it only errors when the options selected are both 0. Of course I may be wrong. Check you report queries to make sure that you're not trying to enter a criteria where the field is a numeric and the test is text or vice versa.
From: roger on 19 May 2010 16:03 in a VB If then statement with 2 conditions you have to put the conditions in parentheses ([Forms]![frmChoose_Reports]![ReportSelector]=1) And ([Forms]![frmChoose_Reports]![ReportType]=1) try that hth "Steve" wrote: > 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 > [Forms]![frmChoose_Reports]![ReportType]=1 > > 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? >
|
Pages: 1 Prev: Not all data is populated when clicking tab? Next: code to use Acrobat menu? |