Hide no data fields in access reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vsts2007
    New Member
    • Sep 2007
    • 56

    Hide no data fields in access reports

    Hi,
    I am new to ms-access, i need some help on reports. I prepared payroll transactions for staff in which there are 14 fields. I want to hide some fields which has no data (only zeros). I want to write a code to whole report not for a particular field. If should appear when some data is there not zeros.

    can somebody help me out in this plzzzzzzzzzz

    vsts
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by vsts2007
    Hi,
    I am new to ms-access, i need some help on reports. I prepared payroll transactions for staff in which there are 14 fields. I want to hide some fields which has no data (only zeros). I want to write a code to whole report not for a particular field. If should appear when some data is there not zeros.

    can somebody help me out in this plzzzzzzzzzz

    vsts
    You will have to do each field individually and put the code in the format event of the report. Something like

    [code=vb]
    If Me!TxtBoxName = 0 Then
    Me!TxtBoxName.V isible = False
    Else
    Me!TxtBoxName.V isible = True
    End If
    [/code]

    Comment

    • vsts2007
      New Member
      • Sep 2007
      • 56

      #3
      Thank you for your support... actually i have a field "dearnesspa y arrears" in my database. when i enter this field name in the code given by you it is showing error on "arrears". is there any problem in field's name..
      please guide me
      and the place should be covered by the next field...

      vsts
      Last edited by vsts2007; Sep 19 '07, 06:07 AM. Reason: regarding empty space

      Comment

      • vsts2007
        New Member
        • Sep 2007
        • 56

        #4
        Thank you .. its working and the space is not covering by the next field. I need one more help calculation of PF is applicable for only some of the employees but as per my query its calculating for all the employees.. can you help me in this too..

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by vsts2007
          Thank you .. its working and the space is not covering by the next field. I need one more help calculation of PF is applicable for only some of the employees but as per my query its calculating for all the employees.. can you help me in this too..
          Post theSQL of the query you are currently using. Indicate which of the fields would be used to decide which employees are applicable and how.

          Comment

          • vsts2007
            New Member
            • Sep 2007
            • 56

            #6
            Code:
            SELECT Employees.EmployeesID, Employees.[Salary for the month of], Employees.EmployeeNumber, Employees.FirstName, Employees.[Bank Number], Employees.Basic, Employees.[Basic Arrears], [Basic]*0.5 AS Expr1, Employees.[Dearnesspay Arrears], ([Basic]+[Expr1])*0.41 AS Expr2, Employees.[DA Arrears], ([Basic]+[Expr1])*0.3 AS Expr3, Employees.[HRA Arrears], Employees.CCA, Employees.[CCA Arrears], Employees.[Conveyance Allowance], Employees.[Cony Arrears], [Basic]+[Basic Arrears]+[Expr1]+[Dearnesspay Arrears]+[Expr2]+[DA Arrears]+[Expr3]+[HRA Arrears]+[CCA]+[CCA Arrears]+[Conveyance Allowance]+[Cony Arrears] AS Expr4, ([Basic]+[Basic Arrears]+[Expr1]+[Dearnesspay Arrears]+[Expr2]+[DA Arrears])*0.12 AS Expr5, Employees.VPF, Employees.PT, Employees.TDS, Employees.[BENV FUND], Employees.[WEL FUND], Employees.[CCC HYD], Employees.[Vehicle Loan], Employees.[PC Advance], Employees.[GPF Advance], Employees.HBA, Employees.CGEIS, Employees.[Lease Recovery], [Expr5]+[VPF]+[PT]+[TDS]+[BENV FUND]+[WEL FUND]+[CCC HYD]+[Vehicle Loan]+[PC Advance]+[GPF Advance]+[HBA]+[CGEIS]+[Lease Recovery] AS Expr6, [Expr4]-[Expr6] AS Expr7
            FROM Employees;
            This is the SQL view of the query.. fields are Employees.Basic to [HRA Arrears]
            and PF applicable for only first 19 members...

            I asked for covering the vacant place by next field...


            Thank you for your support
            Last edited by NeoPa; Sep 22 '07, 03:23 PM. Reason: Tags

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              Set the can shrink property of all the textboxes to yes.

              Now what do you mean by the first 19 members?

              Comment

              • vsts2007
                New Member
                • Sep 2007
                • 56

                #8
                i put can shrink property to "yes" but still it showing the space

                from 1 - 19 records only the pf is applicable

                Comment

                • MMcCarthy
                  Recognized Expert MVP
                  • Aug 2006
                  • 14387

                  #9
                  Originally posted by vsts2007
                  i put can shrink property to "yes" but still it showing the space

                  from 1 - 19 records only the pf is applicable
                  Yes but how do I know if pf is applicable and when you say from 1-19 are you talking about the EmployeesID?

                  Comment

                  • vsts2007
                    New Member
                    • Sep 2007
                    • 56

                    #10
                    from 1st record to 19th record...employ ee ids are there but numbers are scattered there is no formality in numbering bcos we have some other branches also.

                    what about the space in the reports?

                    Comment

                    • FishVal
                      Recognized Expert Specialist
                      • Jun 2007
                      • 2656

                      #11
                      Hi, there.

                      You may take a look at the similar thread
                      "Moving" a line in a Report based on 2 conditions

                      Comment

                      • MMcCarthy
                        Recognized Expert MVP
                        • Aug 2006
                        • 14387

                        #12
                        Originally posted by vsts2007
                        from 1st record to 19th record...employ ee ids are there but numbers are scattered there is no formality in numbering bcos we have some other branches also.

                        what about the space in the reports?
                        You can use SELECT TOP 19 ....

                        However, there is no guarantee which records will be returned as you haven't specified a sort order. Also you still haven't told me how to distinguish which employees have pf applicable.

                        Comment

                        • vsts2007
                          New Member
                          • Sep 2007
                          • 56

                          #13
                          Hi,
                          thanks for your support... i went through the page suggested by you.

                          i have fields like pf, vpf, pt, tds, bnvfund, extra.. in some records there are no values for pf, vpf, pt, tds and have values in bnvfnd. so i want to hide all the first four fields. can you suggest me the code for this.

                          Thank you,
                          vsts

                          Comment

                          • vsts2007
                            New Member
                            • Sep 2007
                            • 56

                            #14
                            Hi,
                            i am able to hide the null values in the report but the space is not covered by the next field... can you suggest me in this to cover the space.. i made all the fields "CAN SHRINK"..but nothing is working.

                            thank you for your support

                            Comment

                            • MMcCarthy
                              Recognized Expert MVP
                              • Aug 2006
                              • 14387

                              #15
                              Originally posted by vsts2007
                              Hi,
                              i am able to hide the null values in the report but the space is not covered by the next field... can you suggest me in this to cover the space.. i made all the fields "CAN SHRINK"..but nothing is working.

                              thank you for your support
                              Did you read the thread FishVal directed you to?

                              Comment

                              Working...