Open Multiple Reports With a Common Field

Taquecop

New member
Local time
Today, 01:16
Joined
Mar 31, 2014
Messages
7
I have four forms named [Information Form], [Evidence Form], [Subject Form], and [Vehicle Form]. The Final Form is a Tabbed Form named [New Incident]. The tabbed form has four tabs, with each tab displaying one of the forms above. I also have a Print Command Button named [Print All] underneath the tabbed portion of the [New Incident] form. Also, All of the four forms are set to data entry - yes, so that on open they will be clean and read for new record entry. I need the [Print All] button to do, just that, print everything that has or has not just been entered into the four forms, even if some are printed blank because they were not neccisary for this particular report. One thin of note is that each form on the tab has a field for the "Incidnet Number" which will be the same for all four forms.
Please help, I know nothing about writing code so I may need a step by step. Thanks for any advice. Also I can get pictures of my current project if needed.
 
I guess I also should have stated that If I am working on a record that all forms and tables share incident number "XYZ123" Then I only want the reports that show "XYZ123"
 
I can't seem to get it to work, this can't be this hard. I copied and pasted the line from your link (with the extra "'" and without) what am I doing wrong, I would post pictures but apparently I am to New to the forum
 
Posting the code may be enough, along with the data type of any field in the criteria.
 
Docmd.OpenReport "Information Report",,,"Incident Number = " & me.INPUT
Docmd.OpenReport "Information Report",,,"Incident Number = '" & me.INPUT & "'"
This is what Ive got, not sure it helps, Also I do have a query with all fields but not sure what to put in the criteria field, nothing seems to change the outcome, Ive got it where it will open the report to only one record view but all fields are blank. Also I zipped and attached the photos and it still said I needed more posts.

I thought there would be a way to do this with a macro.
 

Attachments

Ok, I feel this is probably a simple fix and I'm looking to far into it. I have a OpenReport macro with arguments:
Report Name - Information Report
View - Print Preview
Filter Name - Query2
Where Condition - [Incident Number] = [Forms]![New Incident]![INPUT] ( with INPUT being a text box control )
Window Mode - Normal

I feel as if the Where Condition is my problem because everytime I click the button that runs the macro, A dialog box pops up asking for the [Incident Number] that I have to manually enter instead of simply drawing the information from [INPUT] like I want it to. Once Manually entered, the report opens just like I want it to, I am simply attempting to bypass manually entering the [Incident Number].

Also I have looked a lot on the internet with a common solution being the event process that pbaldy recommended. I am not against this process, but it isn't working and I have no Idea why. When I enter that command, the line automatically turns yellow like something is wrong.
 
In this code, the field needs to be bracketed because of the inadvisable space:

Docmd.OpenReport "Information Report",,,"[Incident Number] = " & me.INPUT
 
Thanks, That did do something different, Now when I click it, A dialog box opens that says now printing, and a second dialog box opens that says "Enter Parameter Value". I don't understand. I didn't tell it to print, And INPUT should have given it its parameter value. ??? I'm getting more confused
 
It would be more appropriate to say you didn't tell it not to print, as printing is the default. Look at OpenReport in VBA help for the argument to preview instead. If you're getting a parameter prompt, either that field doesn't exist in the report's source or Input isn't a control on the form the code is in.
 
Thanks to everyone who helped, But I finally figured it out using only macros and queries. Now the entire program works like I want it to. Thank you all
 

Users who are viewing this thread

Back
Top Bottom