If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
show select records in report
Shows every record: Private Sub Report_Open(Cancel As Integer) Dim stDocName As String Dim strInvoicing As String Dim strSites As String strInvoicing = "InvPercent" strSites = "Base List.Subform!SiteComplete" Shows one page of report but fields are blank.... Private Sub Report_Open(Cancel As Integer) Dim stDocName As String Dim strInvoicing As String Dim strSites As String strInvoicing = "InvPercent" strSites = "Base List.Subform!SiteComplete" stDocName = "Open Projects" DoCmd.OpenReport stDocName, acPreview, wherecondition:=strInvoicing & strSites = "1" End Sub stDocName = "Open Projects" DoCmd.OpenReport stDocName, acPreview, wherecondition:=strInvoicing = 1 & strSites = 1 End Sub |
#2
|
|||
|
|||
show select records in report
Don't follow what you are doing. You're trying to open a report in its Open
event, i.e. while it's already opening? Are you trying to filter the report? If so, some alternatives: a) Use another event (such as the Click of a command button on a form) to open the report with a WhereConditon. Examples: http://allenbrowne.com/casu-15.html http://allenbrowne.com/casu-08.html b) Set the report's Filter in its Open event, e.g.: Dim strWhere As String strWhere = "[City] = ""New York""" 'Debug.Print strWhere Me.Filter = strWhere Me.FilterOn =True For (b), your filter string needs to include a field name and a value to match. It needs to look like the WHERE clause in a query. To see how it should look, mock up a query, switch to SQL view, and look at the WHERE clause. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Cuda" wrote in message ... Shows every record: Private Sub Report_Open(Cancel As Integer) Dim stDocName As String Dim strInvoicing As String Dim strSites As String strInvoicing = "InvPercent" strSites = "Base List.Subform!SiteComplete" Shows one page of report but fields are blank.... Private Sub Report_Open(Cancel As Integer) Dim stDocName As String Dim strInvoicing As String Dim strSites As String strInvoicing = "InvPercent" strSites = "Base List.Subform!SiteComplete" stDocName = "Open Projects" DoCmd.OpenReport stDocName, acPreview, wherecondition:=strInvoicing & strSites = "1" End Sub stDocName = "Open Projects" DoCmd.OpenReport stDocName, acPreview, wherecondition:=strInvoicing = 1 & strSites = 1 End Sub |
Thread Tools | |
Display Modes | |
|
|