Results 1 to 12 of 12
  1. #1
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154

    How to hide the text box when the ünbound field is Zero

    Dear all

    Need help for the way to hide the text box when the ünbound field is Zero

    I am making a voucher for my client who has selected few items in a conference.
    I have to prepare a voucher for everyone in a summary what they booked, i.e the field with "1"


    Please kindly help, it bother me for a while, as i try Can Shrink for the Unbound box but the textbox cannot be removed

    ThanksDatabase101.accdb

    I get some information on website
    https://answers.microsoft.com/en-us/...1-c6ee0be8b36d

    But i do not understand where to put it ( i am new to ACCESS)



    =IIf(IsNull([YourMemoFieldName]),Null,"Label Caption Value")


    The expression should be placed in the control source of a text box that replaces a label control.


    Please consider your report will have Label and text box controls. They both have a "name" property. The label control has a Caption property and a text box has a Control Source property.


    Really appreciated help, i did try due to my limited knowledge , please help

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Please be more specific - what is the name of the unbound field (I do not see one on your report), what is the name of the field to be hidden.

  3. #3
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    All the fields -

    Country A
    Country B
    Graduate
    Pass_A_28 Nov etc..


    In the report, the field Country A is 1, then it shows in the report, the Country B is "0"should not shown
    But the text box Country B _Label can not hide

    Eric

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the OnFormat event of the Detail section (click on the Detail line):

    Code:
        If Me!CountryA = 0 Then
            Me!CountryA.Visible = False
        Else
            Me!CountryA.Visible = True
        End If
        
        If Me!CountryB = 0 Then
            Me!CountryB.Visible = False
        Else
            Me!CountryB.Visible = True
        End If
    
    ..etc...

  5. #5
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    it does work

  6. #6
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    Can you send me back the file ?

    Click image for larger version. 

Name:	Capture1.JPG 
Views:	8 
Size:	29.7 KB 
ID:	30848Click image for larger version. 

Name:	Capture2.JPG 
Views:	8 
Size:	46.0 KB 
ID:	30849

    Did i did anything wrong?!

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    It is in your first post - ? Is there something you don't understand?

  8. #8
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    i lost

    I have placed your advise

    If Me!CountryA = 0 Then
    Me!CountryA.Visible = False
    Else
    Me!CountryA.Visible = True
    End If

    If Me!CountryB = 0 Then
    Me!CountryB.Visible = False
    Else
    Me!CountryB.Visible = True
    End If

    into the on format under the Detail section

    But the Country A text box and Country B Text box still shown even if this is 0

    So, i wonder if you have post the same on my sample file and i can have a view

    Eric

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    It seems that if you double-click the report to open it, it does not work, but if you go to Print Preview then it works!

  10. #10
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    You are right

    When it comes to print mode, it hide all
    this is what i want

    Thanks

  11. #11
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    aytee

    Is there any difference between

    Me!CountryA = 0 and Me.CountryA = 0

  12. #12
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Yes there is a difference. Google "bang vs dot".

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

Similar Threads

  1. Show & Hide Text Box with a Button
    By aamer in forum Access
    Replies: 3
    Last Post: 07-30-2016, 09:40 PM
  2. Hide value of text box
    By vicsaccess in forum Forms
    Replies: 3
    Last Post: 02-21-2016, 08:59 AM
  3. Hide/Replace numeric value with text value
    By gaker10 in forum Reports
    Replies: 2
    Last Post: 03-13-2015, 09:19 AM
  4. Hide Show Text Box
    By Derrick T. Davidson in forum Forms
    Replies: 3
    Last Post: 04-09-2013, 11:13 PM
  5. Making a toggle button hide a text box.
    By RemonKoybito in forum Forms
    Replies: 3
    Last Post: 05-20-2011, 11:34 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