Results 1 to 6 of 6
  1. #1
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    558

    Field visibility false, on a sub report.

    In my accounting application I managed to hide columns with the code below. It is columns or fields on the sub form, even though the code is placed on the main form. This is a form through which I capture payments.
    Click image for larger version. 

Name:	221208b.png 
Views:	15 
Size:	26.4 KB 
ID:	49270


    Generally, reports display very similar than the forms. I want a field (cboComent_IDaj) on a sub report to display on a condition. The fields visibility is set to "no" on the sub report. I tried the following code without success.
    Click image for larger version. 

Name:	221208c.png 
Views:	13 
Size:	17.3 KB 
ID:	49271
    The condition is in query q02PaymentsSub.BatchtypeA if the word "Salaries" or "Wages" is there, the field (cboComent_IDaj) must turn visible on the sub report.
    I also tried the code below.
    Click image for larger version. 

Name:	221208a.png 
Views:	13 
Size:	14.4 KB 
ID:	49272
    I put on some good time on the internet, no success yet.

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    2,699
    Try using the on format event, that is generally the best place on reports for conditional hiding of things.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    558
    Thank you. I never saw on format event. I do not see it on my list or how to get to it. I "Googled" a bit just now, and see some people getting to it?
    Click image for larger version. 

Name:	221208d.png 
Views:	13 
Size:	12.5 KB 
ID:	49273

  4. #4
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    2,699
    It's a section property not report wide - so possibly in the detail or in the sub-report detail section.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Perfac's Avatar
    Perfac is offline Expert
    Windows 10 Access 2016
    Join Date
    May 2016
    Location
    Centurion Pretoria
    Posts
    558
    Thank you, I learnt something new, and it is working.
    Click image for larger version. 

Name:	221208e.png 
Views:	13 
Size:	13.9 KB 
ID:	49274

  6. #6
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    2,699
    You are welcome. It's not a very well documented "feature"/requirement.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Replies: 8
    Last Post: 12-13-2016, 02:11 PM
  2. Macro using IF to set visibility in report
    By kyle87 in forum Macros
    Replies: 8
    Last Post: 07-23-2013, 01:24 PM
  3. Field visibility in a report
    By PhilTFC in forum Forms
    Replies: 8
    Last Post: 10-29-2012, 12:10 PM
  4. Field Visibility
    By cbrsix in forum Programming
    Replies: 3
    Last Post: 06-27-2012, 03:52 PM
  5. Replies: 0
    Last Post: 11-24-2009, 03:23 PM

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