From: Seddon Acaster on 15 Apr 2010 06:58 2x forms one form contains addresses, each record shows a different address, each record has a unique project_id the other form contains invoices, each record shows a different invoice number, date and project_id i want a button on the address form that opens a report, the report only shows those invoice records that have the same project_id as the record that is currently viewed on the address form how do i do this?
From: Stefan Hoffmann on 15 Apr 2010 07:16 hi, On 15.04.2010 12:58, Seddon Acaster wrote: > i want a button on the address form that opens a report, the report only > shows those invoice records that have the same project_id as the record that > is currently viewed on the address form > > how do i do this? Build your report. You must include the [project_id] field in its data source. When the report is done, place a button named btnReport on the form and add a code event procedure: Private Sub btnReport_Click() DoCmd.OpenReport "ReportName", , , "[project_id] = " & Me![project_id] End Sub mfG --> stefan <--
From: Seddon Acaster on 17 Apr 2010 10:23 Thx Stefan. I tried this and all it did was show all entries rather those filered by project_id. Seddon "Stefan Hoffmann" wrote: > hi, > > On 15.04.2010 12:58, Seddon Acaster wrote: > > i want a button on the address form that opens a report, the report only > > shows those invoice records that have the same project_id as the record that > > is currently viewed on the address form > > > > how do i do this? > Build your report. You must include the [project_id] field in its data > source. > > When the report is done, place a button named btnReport on the form and > add a code event procedure: > > Private Sub btnReport_Click() > > DoCmd.OpenReport "ReportName", , , "[project_id] = " & Me![project_id] > > End Sub > > > mfG > --> stefan <-- > . >
From: Stefan Hoffmann on 19 Apr 2010 04:43 hi Seddon, On 17.04.2010 16:23, Seddon Acaster wrote: > Thx Stefan. I tried this and all it did was show all entries rather those > filered by project_id. Then check whether you have the data source of your report crafted correctly and that you have specified the parameter for the OpenReport in the right command order. It must be the fourth parameter: http://msdn.microsoft.com/en-us/library/aa220304%28office.11%29.aspx mfG --> stefan <--
From: Seddon Acaster on 19 Apr 2010 05:24
This may or may not be relevant but I am using MS Access 2007. "Stefan Hoffmann" wrote: > hi Seddon, > > On 17.04.2010 16:23, Seddon Acaster wrote: > > Thx Stefan. I tried this and all it did was show all entries rather those > > filered by project_id. > Then check whether you have the data source of your report crafted > correctly and that you have specified the parameter for the OpenReport > in the right command order. It must be the fourth parameter: > > http://msdn.microsoft.com/en-us/library/aa220304%28office.11%29.aspx > > > mfG > --> stefan <-- > . > |