I have a form with a single selection Listbox (LstSkipperID) to select a single Dinghy Skipper. The listbox has 3 columns; SkipperID, FirstName & LastName (the SkipperID is not visible).
I can extract ID, FirstName and LastName using Columns 0, 1 & 2.
The report (RptSkipperRaceResults) works OK and currently lists all the Skippers by Date followed by ID order and a standard CommandOpen Report button works OK.
The next stage is for the Report to list a single Skipper (ID) and with the FirstName and LastName at the top of the Report.
I have tried looking at the methods used by others but I can’t figure out how StrWhere works and how to extract the Data at the Report Stage.
The following is my new Command to open the report but it produces the original report showing only 9 pages when there in fact 22 pages.
I assume the WhereCondition would work as a WHERE condition in the SELECT Query??
I’m Lost, could anybody help please?
Pat
Current Form Button Coding to Open the Report
Private Sub CmdOpenRatingReport_Click()
Dim StrWhere, StrReport, Str1stName, Str2ndName As String
StrReport = "RptSkipperRaceResults"
'StrWhere & "AND Str1stName = LstSkipperID.Column(1)"
'StrWhere = StrWhere & "AND Str2ndName = LstSkipperID.Column(2)"
StrWhere = "(SkipperID = LstSkipperID.Column(0)"
DoCmd.OpenReport StrReport, acViewPreview, WhereCondition:=SkipperID
End Sub
The Query that currently feeds the Report
SELECT Race_Dates.RaceDate, Race_Dates.NrEntries, Rating.Skipper_ID, Rating.Rank
FROM Race_Dates INNER JOIN Rating ON Race_Dates.RaceDate = Rating.Race_Date
ORDER BY RaceDate;
I can extract ID, FirstName and LastName using Columns 0, 1 & 2.
The report (RptSkipperRaceResults) works OK and currently lists all the Skippers by Date followed by ID order and a standard CommandOpen Report button works OK.
The next stage is for the Report to list a single Skipper (ID) and with the FirstName and LastName at the top of the Report.
I have tried looking at the methods used by others but I can’t figure out how StrWhere works and how to extract the Data at the Report Stage.
The following is my new Command to open the report but it produces the original report showing only 9 pages when there in fact 22 pages.
I assume the WhereCondition would work as a WHERE condition in the SELECT Query??
I’m Lost, could anybody help please?
Pat
Current Form Button Coding to Open the Report
Private Sub CmdOpenRatingReport_Click()
Dim StrWhere, StrReport, Str1stName, Str2ndName As String
StrReport = "RptSkipperRaceResults"
'StrWhere & "AND Str1stName = LstSkipperID.Column(1)"
'StrWhere = StrWhere & "AND Str2ndName = LstSkipperID.Column(2)"
StrWhere = "(SkipperID = LstSkipperID.Column(0)"
DoCmd.OpenReport StrReport, acViewPreview, WhereCondition:=SkipperID
End Sub
The Query that currently feeds the Report
SELECT Race_Dates.RaceDate, Race_Dates.NrEntries, Rating.Skipper_ID, Rating.Rank
FROM Race_Dates INNER JOIN Rating ON Race_Dates.RaceDate = Rating.Race_Date
ORDER BY RaceDate;