Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Customized Dialog Box

Status
Not open for further replies.

MelF

Technical User
Oct 26, 2000
81
US
I've created an unbound form that prompts for report criteria. I know I've left something out somewhere, because when I run the report, which pulls up this dialog box, I enter the criteria I want, then I get this error:

The object doesn’t contain the Automation object ‘DateRangeForm’.
You tried to run a Visual Basic procedure to set a property or method for an object. However, the component doesn’t make the property or method available for Automation operations.
Check the component’s documentation for information on the properties and methods it makes available for Automation operations.

I created a macro group that consisted of four macros: ok button, cancel button, openform button, close form button. I then put the criteria:
Between [Forms]![DateRangeForm]![Beginning Date] And [Forms]![DateRangeForm]![Ending Date]in the underlying query of my report in the OrderDate column.

Any suggestions? Thanks!!!!!!!
 
Hi Mel,
I get a bit nervous when I read "when I run the report, which pulls up this dialog box". Your report opening is starting up the dialog box? Your report is based on criteria that comes from that dialog box? Won't work. The dialog box has to be up and running before the report opens if above is the case. Try opening the dialog, set your values, then open the report off of the dialog with an open report command button. I'll bet you it'll go... :) Gord
ghubbell@total.net
 
Well, I don't fully understand the problem, but here at the Office, I've implemented lots of unbound forms that pull a report. One of them (the most useful, the users say) uses a lot of list boxes to assemble a SQL string that recovers the info from a table selected from another unbound form that opens a Data Report and pastes the SQL string from the 1st form in the Filter property and the Table name in the Recordsource property. All this happens (the code is located) in the Report's
Code:
Open
Event. The SQL string is invisible to the user and the results are happy users and specific reports. The point is: the forms are always open while the Open Event is happening. When the report is open, the report itself closes the forms with a couple of
Code:
DoCmd.CloseForm
commands.
 
Mel,

I keep half of ghubbel and half of Aristarco, which means:

1)The Criteria Form opens before the Report.
2)The Report's
Code:
On Close Event
should include a command that close the Form.

And something else...If you see on your report something like this #Name...try not to close the Form while you open the Report, just minimize the Form

Good Luck
 
O.K. - I am very confused. I don't know how to get this to work. I've tried your suggestions:

1. I put an OpenReport macro on the O.K. button of my form, it opens the report, but with no info. ???

The query that my form is based on works fine, using the parameters I've put into it (begin and end dates, and product name). I'm wondering, though how the unbound text boxes on my form know which fields to check in when I enter info. into them. ( The form fields just have labels, no control source) ?????

Thanks for all your help!!!
 
Correction on above: The query that my REPORT is based on, not form . . .
 
Hi Mel,
Your two unbound fields must be named "Beginning Date" and "Ending Date" if you have your lines as above in the criteria of your reports query. (And your form is Named "DateRangeForm"). Watch your openreport macro isn't doing any filtering, and I'd suggest pitching it and have the wiz build you an open report command button that runs Visual Basic code instead. Keep going...almost there! :)

Gord
ghubbell@total.net
 
GHUBBELL - Thanks for your reply. I just got it to work!!!!! I was missing the >= signs in my criteria in my query. That seems to have fixed it. We'll see!!

Thanks again!!
 
Bingo! Way to go Mel! You're welcome and take care, :) Gord
ghubbell@total.net
 
Thanks. This was the answer I have been looking for. I had a similar prob. and was able to use your solution.
s-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top