Results 1 to 9 of 9
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434

    report page break with vba-import references

    Hi, i have two questions:

    1) i have a report with a lot of subreports, i use vba on open to select which of them should be visible. I have page breaks between them, so when one or more of them are not visible, i got some blank pages. Is there a way to manage page breaks too in vba?


    2) sometimes i just create a new database and import every elements, i'd like to know if there is a way to add the references (ddl), that i have to manually add




    thanks

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    well, 50% of thanks for you, then

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    As far as the other part of the post is concerned- hide the the page break control that comes before the sub report you are hiding

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    How could i do that? a page break has no visible property

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    I didn't check that, I just looked here

    https://learn.microsoft.com/en-us/of...eBreak.Visible

    But looking further see this link, the question is much the same as yours

    https://www.pcreview.co.uk/threads/s...-data.3615587/

    it does exist, just doesn't appear in the property list.

  7. #7
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    nice to know

    however, i tried this but i got blank pages after the end of the report

    Code:
    Private Sub Report_Open(Cancel As Integer)    Me.RecordSource = "SELECT Trattative.IDtrattativa, Date() AS Data, Trattative.NumeroCandidatoCliente, Candidati.IDcandidato, Aziende.Azienda, Aziende_1.Azienda AS Cliente, Candidati.nome & "" "" & Candidati.cognome AS NomeCognome, Comuni.Comune, Comuni.Regione, Professioni.PosizioneLavorativa, Candidati.[data di nascita], DateDiff(""yyyy"",[data di nascita],Date()) AS Età, Candidati.cellulare, Candidati.[Email personale], Candidati.[Ptf banca personale], Candidati.[Ptf trasferibile personale]," & vbCrLf & _
                          "Candidati.[Ptf trasferibile personale], Candidati.[Numero clienti banca], Candidati.[Numero clienti personali], FormatCurrency(([ptf banca personale]*1000000)/[numero clienti banca],0) AS [Media clienti banca], FormatCurrency(([ptf trasferibile personale]*1000000)/[numero clienti personali],0) AS [Media clienti personale], Candidati.[Ptf gestito], Candidati.[Ptf assicurativo], Candidati.[Ptf amministrato], Candidati.Liquidità, Candidati.[Redditività ptf trasferibile], Trattative.[Note portafoglio], Candidati.[RAL/Fatturato], " & vbCrLf & _
                          "Candidati.Premi, Candidati.[Corrispettivo patto], Candidati.[Patto di non concorrenza], Candidati.[scadenza patto], Candidati.[penale economica], Trattative.profilo, Trattative.[Motivazione al cambiamento], Trattative.Richieste, Trattative.[Note portafoglio gestito in banca], Trattative.[Trattative in essere], Candidati.livello, Candidati.[Ultimo cambio azienda], Candidati.benefit, Aziende_1.logo " & vbCrLf & _
                          "FROM Aziende AS Aziende_1 INNER JOIN (Clienti INNER JOIN (Professioni INNER JOIN (Aziende INNER JOIN ((Comuni INNER JOIN Candidati ON Comuni.IDComune = Candidati.ComuneID) INNER JOIN Trattative ON Candidati.IDcandidato = Trattative.CandidatoID) ON Aziende.IDazienda = Candidati.AziendaID) ON Professioni.IDposizione = Candidati.PosizioneID) ON Clienti.IDCliente = Trattative.ClienteID) ON Aziende_1.IDazienda = Clienti.AziendaID " & vbCrLf & _
                          "WHERE (((Trattative.IDtrattativa)= " & TrattativaIDStr & "));"
    
    
    
    
    
    
       Call SubreportsVis(False)
    End Sub
    
    
    Private Function SubreportsVis(Visibile As Boolean)
       Me.Report_Analisi_portafoglio_banca.Visible = Visibile
       Me.Report_Analisi_portafoglio_trasferibile.Visible = Visibile
       Me.Report_Portafoglio_banca.Visible = Visibile
       Me.Report_Portafoglio_trasferibile.Visible = Visibile
       Me.Report_PTFCittà.Visible = Visibile
       Me.Report_statistiche_portafoglio_banca.Visible = Visibile
       Me.Analisi1INT.Visible = Visibile
       Me.Analisi2INT.Visible = Visibile
       Me.Analisi3INT.Visible = Visibile
       Me.Analisi4INT.Visible = Visibile
    End Function
    Could be something else that adds blank pages?

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    you normally do control manipulation in the relevant section onformat event

  9. #9
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    434
    sorry for late response, thanks
    yes i always forgot that i have to use "onformat"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Page break in a report
    By Dropout in forum Access
    Replies: 29
    Last Post: 03-20-2020, 05:09 AM
  2. Replies: 2
    Last Post: 02-04-2016, 08:13 AM
  3. Replies: 3
    Last Post: 12-22-2015, 03:23 AM
  4. Report with page break appears with a blank page, why?
    By clebergyn in forum Programming
    Replies: 4
    Last Post: 02-24-2014, 12:32 PM
  5. Page break on report inserts empty page between
    By Galadrielle in forum Reports
    Replies: 0
    Last Post: 07-07-2010, 04:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums