Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2006, 01:25 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It gives 2 messages.

---------------------------
Microsoft Access
---------------------------
No No

[20] = 'No' AND [40] = 'No'
---------------------------
OK
---------------------------

Also Run-Time Error 2497
action or method requires report name argument.

-Dave

 
Old June 6th, 2006, 01:29 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Is "Floor Requests" the name of your Report? (Spaces are not a good idea in report names, btw, but of no consequence here.)

Also, is that the criteria you want? It says 20 and 40 are both "No".

You may want to back up and start by creating a button to open the report with no criteria using the button wizard, and then build from that. That button will open the report with the date criteria applied by itself.



mmcdonal
 
Old June 6th, 2006, 01:39 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah Floor Requests I skipped the _

I didn't click a checkbox, thats why everything is No.
I'll have to set up an error message if the user does that.

I've already created a button that opens the report with no criteria. Thats what I'm working on. But you said the date criteria is already applied by itself? I don't understand.

-Dave

 
Old June 6th, 2006, 01:42 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

The report is based on the query, and the query applies the criteria to itself when it is run. It looks at the form, and takes the values from the controls you reference in the criteria for the date. Do you have the SQL from the Query? (Design View, Right Click, SQL View)



mmcdonal
 
Old June 6th, 2006, 01:47 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, gotcha

I'm gonna redo the button and then put the checkbox code in and see where I'm at.

Thanks

-Dave

 
Old June 6th, 2006, 02:11 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I've redone the button, but I'm still getting the same error message saying a report name argument is required. Am I supposed to switched the stDocsName for the Report name? Or is it something else?

-Dave

 
Old June 6th, 2006, 02:51 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This still isn't working.
I deleted the entire sub procedure and built a new button that previews the report. I clicked the build event for the button and the computer generated code spawned. I left it as is, ran the form and the whole report came up. It payed no attention to the dates I put in there. I don't think its looking at the criteria at all.

-Dave

 
Old June 7th, 2006, 06:34 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is what you must do first:

Using the button wizard, create a button that opens the report. The wizard should be able to do this since you must point to the report you want to open, so there will be no mistakes.

Since the query behind the report looks for the values in the controls on your forms, nothing can be broken for the date field.

Once this is working, then we can look at the Yes/No fields.

Please use the wizard and get this working, then post the code the wizard wrote, the name of your form, the names of the yes/no controls, and the SQL from the query behind the report.

How's that?


mmcdonal
 
Old June 7th, 2006, 11:23 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I figured out one problem I was having.
I had the record source for the form set to the table instead of the query. thats why the criteria for the date field wasn't being picked up.
I put the check box code in, but when I compile I get an enter parameter value pop up box.
Do you know why I am getting this pop up?

-Dave

 
Old June 7th, 2006, 11:27 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What code did you put in? Is there a criteria for the check boxes in the query? If so, what is the SQL code. It would be good if you could post that code.

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple criteria on a select query? jihadbuster XSLT 4 March 19th, 2008 01:52 PM
IIF multiple criteria stealthdevil Access VBA 10 November 28th, 2007 11:37 AM
Multiple Search Criteria in a Form tet Access VBA 5 October 27th, 2007 08:54 AM
stLinkCriteria - Multiple Criteria andyv123 Access 1 September 8th, 2006 10:02 AM
Criteria query with multiple fields penta Access 8 October 25th, 2004 11:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.