Access Custom Dialog Boxes for Report Criteria

G

Guest

Custom Dialog Box for Report Criteria

I’ve got a problem with a custom dialog box in Microsoft Access 2002 and am
hoping someone can help me with this.

The situation is:

I am using a report based on a query (with the criteria set in the query
design), a custom dialog box that utilizes both Access VBA and macros. The
primary macro is a macro group that controls the custom dialog box and
criteria entry, etc. The secondary macro (when triggered by the VBA Event
Procedure) prompts the user to enter the criteria if the dialog form OK
button is clicked without any data in the criteria window.

All of the various components appear to work exactly as they should when run
independently. The problem arises when they are used in conjunction with
each other.

When using a form control to open the report, the custom dialog box is
opened and everything functions as it should except for the Cancel button on
the form, which is tied to a Close Form macro in the macro group. (This
button works perfectly on the dialog box when that form is opened by itself.)

In the “normal use†sequence, when the Cancel button is clicked, I get the
following Access error message:

“The expression you entered has a function name that Microsoft Access can’t
find.â€

When I click OK, the error message closes, but I am then presented with the
default Access criteria dialog box (“Enter Parameter Valueâ€) for the report.

If I enter the necessary criteria and click OK, the report will run
normally. If I click Cancel on this box, the criteria box closes and I get
the standard Access message “The OpenReport action was canceled.â€

Anybody know what’s going on here and how I can fix it?
 
G

Guest

Hi Frank,

If you are willing to wean yourself away from macros, and use VBA code
exclusively, I have an excellent sample that I can send to you. This sample
includes a .mdb file and a Powerpoint presentation.

You need to trap for Error # 2501 in order to suppress the message “The
OpenReport action was canceled.â€

If you'd like me to send you the sample, send me a private e-mail message
with a valid reply-to address. My e-mail address is available at the bottom
of the contributors page indicated below in my signature. Whatever you do,
please do not post your e-mail address (or mine) to a newsgroup reply. Doing
so will only invite the unwanted attention of spammers.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

:

Custom Dialog Box for Report Criteria

I’ve got a problem with a custom dialog box in Microsoft Access 2002 and am
hoping someone can help me with this.

The situation is:

I am using a report based on a query (with the criteria set in the query
design), a custom dialog box that utilizes both Access VBA and macros. The
primary macro is a macro group that controls the custom dialog box and
criteria entry, etc. The secondary macro (when triggered by the VBA Event
Procedure) prompts the user to enter the criteria if the dialog form OK
button is clicked without any data in the criteria window.

All of the various components appear to work exactly as they should when run
independently. The problem arises when they are used in conjunction with
each other.

When using a form control to open the report, the custom dialog box is
opened and everything functions as it should except for the Cancel button on
the form, which is tied to a Close Form macro in the macro group. (This
button works perfectly on the dialog box when that form is opened by itself.)

In the “normal use†sequence, when the Cancel button is clicked, I get the
following Access error message:

“The expression you entered has a function name that Microsoft Access can’t
find.â€

When I click OK, the error message closes, but I am then presented with the
default Access criteria dialog box (“Enter Parameter Valueâ€) for the report.

If I enter the necessary criteria and click OK, the report will run
normally. If I click Cancel on this box, the criteria box closes and I get
the standard Access message “The OpenReport action was canceled.â€

Anybody know what’s going on here and how I can fix it?
 

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