Report Record Source

S

Simon Harris

Hi All,

I understand how to build a basic report, and how to set the record source
to a table/query.

Can someone please advise how I would do this dynamically? Heres the
scenario:

1) User searches for data (Done..Working)
2) Matching data is then displayed in a sub_form in datasheet view
(Done...Working)
3) User asked via a prompt if they want to print the records found
(Done...well, the prompt appears!)

Next step - Open a report, setting the recordsource of the report to match
the query that populated the subform.

Any help will be much appreciated.

Simon.

--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
 
S

Simon Harris

Might have solved it...is this an acceptable method?

Private Sub Report_Open(Cancel As Integer)
'Set the recordsource for the report so it matches the customer listbox
rowsource
Reports!RPT_currently_viewed_jobs.RecordSource =
Forms!Frm_switchboard!JobsReportSQLStorage.Value
End Sub
 
P

Pieter Wijnen

If it works...

Pieter

Simon Harris said:
Might have solved it...is this an acceptable method?

Private Sub Report_Open(Cancel As Integer)
'Set the recordsource for the report so it matches the customer listbox
rowsource
Reports!RPT_currently_viewed_jobs.RecordSource =
Forms!Frm_switchboard!JobsReportSQLStorage.Value
End Sub



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top