Results 1 to 3 of 3
  1. #1
    Ucan is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Location
    Annecy, France
    Posts
    2

    How to design a report ?

    I have probblems about the way to design this report:
    I wish to print all or part of a document.
    This document is built on a huge table divided into several tables. All these tables are connected by a 1/1 relationship as shown in the screen below
    Click image for larger version. 

Name:	screenshot relations.jpg 
Views:	16 
Size:	42.2 KB 
ID:	37545

    I do not need to print systematically all the chapters of the document. A chapter roughly corresponding to a linked table.
    Through a form and checkboxes, I wish I could select either this or this chapter to print.
    Click image for larger version. 

Name:	formulaire-print.jpg 
Views:	16 
Size:	8.7 KB 
ID:	37546



    Unfortunately, I do not see how to perform this operation.
    I think I would need a query (maybe many of them... ?) but how can I connect the checkbox with the elements of the selected tables to be printed?

    Any suggestions would be greatly appreciated.
    One last point I don't write code in VBA.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Checkboxes and radios are a problem for this. You'd need to create many queries or reports to get it to work with these controls.
    but, there are alternates:
    1. use lists (and a table). These values can be added/removed without more programming. User picks items in a listbox, these are added to a 'picked' table, this table is joined
    to the data table so that only these values show in the query. No code.

    2. using some VB, you could collect the checkbox items selected then open the report with that filter:

    Code:
    '----------------
    sub btnFilter_click()
    '----------------
    dim sWhere as string ,sWhere2 as string
    sWhere = "1=1"
       'collect true checkboxes
    if chkBrf.value  then sWhere2 = sWhere2 & " [Impress]='Brief' or "
    if chkBM.value  then sWhere2 = sWhere2 & " [Impress]='BusModel' or "
    if chkSynth.value  then sWhere2 = sWhere2 & " [Impress]='Synthetic' or "
    
       'add AND ,remove last OR
    IF sWhere2 <> "" then  sWhere = " and " & left(sWhere2, Len(sWhere2)- 4)
    
    If sWhere = "1=1" Then
      docmd.OpenReport "rMyReport",acViewPreview 
    Else
      docmd.OpenReport "rMyReport",acViewPreview ,,sWhere 
    End If
    end sub
    you can also use it on a form of all records using this filter:
    Code:
    If sWhere = "1=1" Then
      Me.FilterOn = False
    Else
      Me.Filter = sWhere
      Me.FilterOn = True
    End If
    end sub

  3. #3
    Ucan is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Location
    Annecy, France
    Posts
    2
    Thx Ranman for these 2 hints.
    I might give a try with the first one even though I don't see yet exactly how to do this: "these are added to a 'picked' table, this table is joined
    to the data table so that only these values show in the query".
    But I'm going to think about it...

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

Similar Threads

  1. Replies: 0
    Last Post: 07-27-2018, 02:17 PM
  2. How best to design this query and report
    By Daisy509th in forum Queries
    Replies: 7
    Last Post: 03-13-2018, 08:27 AM
  3. report design
    By sunil in forum Reports
    Replies: 3
    Last Post: 01-26-2015, 11:43 AM
  4. design Report
    By Rasha in forum Access
    Replies: 1
    Last Post: 04-28-2014, 02:58 AM
  5. Report Design
    By cbrsix in forum Reports
    Replies: 2
    Last Post: 06-27-2012, 07:10 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