Access report management

A

Access Beginner

i have a form on an access FE (access 2000) i use one combo box to determine
which report is loaded on a click event, at the moment they open in
acViewPreview,

but i wish to be able to have a combo box with acViewNormal and
acViewPreview as the options and then have the vba grab the view method
however i get type mismatch error any advice? or help here is my code

dim ReportName as Variant
dim Method as Variant
ReportName = me.cboreport
Method = me.cboMethod

doCmd.OpenReport ReportName, Method
 
A

Access Beginner

The people that are using this system are not to clever, hence why all the
reports are in a combo box, the last version of the program had a button for
each report and it frustrated them,

they asked if this could be worked into this version
 
J

John W. Vinson

On Thu, 11 Dec 2008 16:21:01 -0800, Access Beginner <Access
i have a form on an access FE (access 2000) i use one combo box to determine
which report is loaded on a click event, at the moment they open in
acViewPreview,

but i wish to be able to have a combo box with acViewNormal and
acViewPreview as the options and then have the vba grab the view method
however i get type mismatch error any advice? or help here is my code

dim ReportName as Variant
dim Method as Variant
ReportName = me.cboreport
Method = me.cboMethod

doCmd.OpenReport ReportName, Method

acViewNormal is actually a VBA constant equal to 0; acViewPreview is another
constant equal to 2. So use 0 and 2 as the values in the (hidden) bound column
of cboMethod - rather than the strings "acViewNormal" and "acViewPreview" -
and you can do it all in one line:

DoCmd.OpenReport Me!cboReport, Me!cboMethod
 

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