Solved AutoHide Column in Report (1 Viewer)

CJ_London

Super Moderator
Staff member
Local time
Today, 13:53
Joined
Feb 19, 2013
Messages
16,553
haven't looked at the code, but you would need to adjust the left property for the label and textbox - or just swap the columns round so salary is on the left anyway
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:53
Joined
May 7, 2009
Messages
19,169
we can use another hack.
on the report, i renamed Bonus label to lbl1, Salary label to lbl2.
also renamed Bonus textbox to txt1 and Salary textbox to txt2.

see the code of the Open event of the report.
 

Attachments

  • bonus.accdb
    864 KB · Views: 111

Jayessh

Registered User.
Local time
Today, 19:23
Joined
Dec 30, 2019
Messages
36
we can use another hack.
on the report, i renamed Bonus label to lbl1, Salary label to lbl2.
also renamed Bonus textbox to txt1 and Salary textbox to txt2.

see the code of the Open event of the report.
Otherwise I made it as like, I mean I have placed the Bonus Column as and last column of the report so if it disappear no one can guess...

The New Prob is... I have same Table/query for every month Salary Calculation like

EMP | Month | SalAmt
Abc| Nov-2020 | 20000

in next month I'll add values in same column like

EMP | Month | SalAmt
Abc| Nov-2020 | 20000

The Same rptSalarySheet will be printed based on month filter

now, if the column Bonus has the value in Oct-2020 but even it will appear in Nov-2020's report

1604651264309.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:53
Joined
May 7, 2009
Messages
19,169
i don't understand.
you can have a Filter on the Dlookup() function (google it).
so say you are filtering by Month field:

If DCount("1", "yourQuery/Table","[Month]='Nov-2020' And Nz([bonus], 0) > 0") = 0
...
...
end if
 

Jayessh

Registered User.
Local time
Today, 19:23
Joined
Dec 30, 2019
Messages
36
i don't understand.
you can have a Filter on the Dlookup() function (google it).
so say you are filtering by Month field:

If DCount("1", "yourQuery/Table","[Month]='Nov-2020' And Nz([bonus], 0) > 0") = 0
...
...
end if
I have attached DataBase here pls go through it Sir
 

Attachments

  • Files.zip
    547.4 KB · Views: 119

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:53
Joined
May 7, 2009
Messages
19,169
check the report (test).
 

Attachments

  • Files.zip
    536.6 KB · Views: 122

Users who are viewing this thread

Top Bottom