Need Report button on form(for current Record only)

morfusaf

Registered User.
Local time
Today, 05:20
Joined
Apr 24, 2012
Messages
78
Basically I have a report that I want to run( I made it look like a form I usually have to hand write with the information)

So I have this Form, on the Form, i create an event, I input dates, times, locations.... blah blah... now I want a button so I can "Print" this form in a better view(basically the view I have created using the report).

The problem is, when I make the button run the report... it runs it for every event/Record I have... tons of pages... I want to be able to click the button, and it only run the report on the currently loaded record/Event

Any help?
 
Humm, well, that doesn't do exactly what i want...

For somereason it ask me what the (EventID) is....

I was hopeing to get the current EventID from the form...


I do think, if I am creating a new record... maybe I will have to AddRecord, then get that eventID created and pass that to the report..


So, could I do something like....

Add Record button(ie... Create New event) and then run report.... ? just with 1 button... and it runs the report on the record it just saved?
 
Doesn't work ... still ask me for my Event ID... see attached db... saved in 03 and 07...

On the formCreateNewEvent ... the Open Report ???? button... or if you can make it work on the add Event button... or have an Add event and Print form.
 

Attachments

I was't using a query to open the report, I was using

Code:
Private Sub btnReport_Click()
If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
End If
DoCmd.OpenReport "reportColorGuardRequestForm", acViewPreview, , "EventID =" & Me.EventID
End Sub

If you are saying I need it in that statement.... where? I thought that is what the "EventID =" was doing.
 
OK, I think I figured out what you meant..

Open the report, go to record source and add EventID...

I do that, and it works once.... then for some reason, I try to run it again and it doesn't work. I go back to the query and EventID is removed? I tried this 3 times.
 
What are you using as a Record Source for the Report.
 
OK I think I got it... I was unchecking the Show box... apparently, when I keep the checkbox checked it works.

Now, one more issue has arose though..

When I type anything in this report, it saves a record. I don't want it to save the record until I click btnAddEvent or, the btnOpenReport button.
 
You will need to use an Unbound Form. ie a Form with no Record Source.

Then you will have to do everything by code.
 

Users who are viewing this thread

Back
Top Bottom