open rapport (by ID) with button in form

Ankie

Registered User.
Local time
Today, 18:43
Joined
Apr 18, 2006
Messages
15
Hi people,

I have made a form. By giving an ID up firstly this form of the concerning person appears. Now I want to make a link to a report on this form. The intention is then that only those data are shown in the report of the concerning person (therefore with the ID that is reflected in the form).

Now I can open the report by means of a button... but then to get the correct data I have now used a query with a parameter value (the ID) (the report has been based on these query). But the situation is now therefore that if you click on the button that you must introduce the parameter value firstly. Is there also a solution where this is no longer necessary??... therefore that you have to click only on the button and then the concerning data of the report are shown. Therefore by giving in or an other manner the ID with. ??

Hopefully it is understandable, (my english is not that good...)

thanks!
Ankie
 
Good afternoon

Your English is very good. To open a report from a button on your main form, the general code would be as follows, where the RecordID has to be available on the form as well as on the report.


DoCmd.OpenReport "rptDetails", _
WhereCondition:="RecordID=" & Me.RecordID
 
Well if I use that code, then the report will be printed. I just want to open and show the report... how can I do that...
I'm not so known in Visual Basis...

Thanks
 
I just solved my problem, thanks for the code!
 

Users who are viewing this thread

Back
Top Bottom