473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Hide a Row @ Report ( Access 2010 )

Hi,

Im trying to hide a rows where there is now value.

Data is coming from a query.

Row 2 of detail section has 3 fields ( Site2, SitName2, Utilization2)

I need to hid this row if site2=null & sitename2 = null & utilization2=0

Thanks for help.
Aug 29 '16 #1
13 1629
PhilOfWalton
1,430 Expert 1GB
Try setting all 3 fields to CanShrink and CanGrow to true
Set the report detail to CanShrink and CanGrow to true

on the OnFormat of the detail, use something like
Expand|Select|Wrap|Line Numbers
  1.  
  2.     Site2.Visible = 
  3.  
Aug 29 '16 #2
PhilOfWalton
1,430 Expert 1GB
Sorry, pressed the wrong key

Expand|Select|Wrap|Line Numbers
  1.    If Nz(Site2) = 0 then
  2.        Site2.Visible = False
  3.    Else
  4.     Site2.Visible = True
  5.    End If
  6.  
  7.    If Nz(SitName2) = 0 then
  8.        SitName2.Visible = False
  9.    Else
  10.     SitName2.Visible = True
  11.    End If
  12.  
  13.    If Nz(SUtilization2) = 0 then
  14.        Utilization2.Visible = False
  15.    Else
  16.     Utilization2.Visible = True
  17.    End If
  18.  
Phil
Aug 29 '16 #3
Thanks Phil,

Did that all but no effect at 2nd row. It remains there.

Please refer to attached images.

Regards.
SAM
Slide1:


Slide2:


Slide3:


Slide4:


Slide5:

Attached Images
File Type: jpg Slide1.jpg (44.6 KB, 463 views)
File Type: jpg Slide2.jpg (20.2 KB, 448 views)
File Type: jpg Slide3.jpg (44.4 KB, 427 views)
File Type: jpg Slide4.jpg (29.0 KB, 431 views)
File Type: jpg Slide5.jpg (15.9 KB, 427 views)
Aug 30 '16 #4
PhilOfWalton
1,430 Expert 1GB
Sorry, Sam, the images are too fuzzy to see in detail.

However it looks as if you have Combo boxes on your report which shouldn't be there as data in your report is static - not relevant to your problem, but a point just the same.

In Slide5.jpg, what is in the column on the right?

Have you set the Report Detail to CanShrink & CanGrow to True?

Phil
Aug 30 '16 #5
Hi,
Yes Report Detail Can Shrink & Can Grow are set to "Yes".

The right column is Utilization2 to Utilization6, as i actually have 5 rows to hide/show depending on data in there. in my question i have mentioned row 2 only to keep it simple.

I'v now replaced combos with text box & visible=false is working but for last column "Utilization2" it's not working. It's a numeric field does that matter for Nz().

Regards,
SAM
Aug 30 '16 #6
PhilOfWalton
1,430 Expert 1GB
Hi Sam

If a field is numeric, and you want to see if it is Null, you use
Expand|Select|Wrap|Line Numbers
  1.    If Nz(MyField) = 0 then .......
  2.  
If a field is Text, and you want to see if it is Null, you use
Expand|Select|Wrap|Line Numbers
  1.    If Nz(MyField) = "" then .......
  2.  
It appears that in Slide5, the Utilization2 is 0.
Are you really sure this is a numeric field, and not a text field with "0" in it?

You could try, in order to cover both possibilities,
Expand|Select|Wrap|Line Numbers
  1. If Nz(MyField) = 0 Or Nz(MyField) = "" then .......
  2.  
but that really shouldn't be necessary.

If that doesn't work, as an experiment, remove the Utilization2 from your report and see what happens.

Phil
Aug 30 '16 #7
Adjusted but no effect. Problem lies with Utilization
I removed the field & rest was working perfectly.
Aug 30 '16 #8
PhilOfWalton
1,430 Expert 1GB
Not sure what the problem is.

Can you strip any sensitive information from your Db and either send me a copy directly, or post it on Bytes
Phil
Aug 30 '16 #9
Hi,

DB enclosed
report name is Qr_Rpt_SiteList
Attached Files
File Type: zip DC_Resource_D_tst.zip (237.0 KB, 73 views)
Aug 30 '16 #10
PhilOfWalton
1,430 Expert 1GB
Sam

Can I suggest that at the head of each module (and any new ones that you create) you have
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
You already have Option Compare Database,
but the Option Explicit ensures that any items referenced in your code do really exist.

When you Compile this you will get a number of errors.
Please correct them and if you are not getting the required results, attach the revised DB and we will have another look.

Phil
Aug 30 '16 #11
zmbd
5,501 Expert Mod 4TB
AccessLearner73
Welcome to Bytes.com

1) Just to give you some guidance on what Phil is asking you to do please read the Section A section of the following: https://bytes.com/topic/access/answe...on#post3803251

You may need to repeat the Debug\compile step several times, fixing each error found in turn, until this step completes without error.

2) Just to clarify, You want the controls on the report to be hidden and the remaining record information shown? I'd look at the report result; however, the code will not compile.
Sep 7 '16 #12
Thanks ZMBD.

I am sure Phil is trying to help me but after adding Option Explicit to code i am getting errors i don't even know what to do with them. Still struggling. Hope it works.
Sep 7 '16 #13
PhilOfWalton
1,430 Expert 1GB
Sorry about that, AccessLearner73, That's exactly what Option Explicit is supposed to do.

For example, if you have a control on a form or report called "My Name" and in the code you call it "MyName" (without the space), the compiler will give an error.

You will need to use a Dim statement to declare all variables in your code, and the compiler will then throw an error if you refer to a variable that you haven't declared.

So similarly, in your code, without the Option Explicit statement you write something like
Expand|Select|Wrap|Line Numbers
  1. [MyDate] = Now()
  2.  
and somewhere else you write
Expand|Select|Wrap|Line Numbers
  1. [My Date] = Now
  2.  
, you won't get an error.

Using the Option Explicit, within your Function or Sub, somewhere you will need to have a statement
Expand|Select|Wrap|Line Numbers
  1. Dim MyDate as Date
  2.  
Then the compiler will be happy with the first bit of code, but throw an error on the second example.

Sorry, I know it's a pain, but as zmbd says, it's just something you have to work through. The chances of your DB working reliably without a "Clean Compilation" are pretty low.

Phil
Sep 7 '16 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: jbrumbau | last post by:
Hello, In Access 2010/2007, how do you prevent users from flipping into design view from the ribbon? I do not want to hide the entire ribbon (DoCmd.ShowToolbar "Ribbon", acToolbarNo) or even the...
3
by: minnichj | last post by:
Is there a way to force an Access 2010 report to resize so all columns print out on one page (I'm looking for something similar to the "Fit to:" Page setup feature in Excel)? VB Code preferred.
4
beacon
by: beacon | last post by:
Hi everybody, My title may not exactly describe my issue, so please forgive my lack of creativity today. I've got a database that was created in Access 2003 that I've opened in Access 2010. I...
1
by: newtoaccessvba | last post by:
I am not too familiar with VBA in Access, but I would like if someone could show me how to ignore a caption and it's field in an Access 2010 Report and an Outlook Email when the field value is it is...
7
dgaletar
by: dgaletar | last post by:
To start off, I am a serious "newbe" to Access, and have probably made countless mistakes thus far in the design of this database. I work as a fleet mechanic for a University in DC, and am trying...
5
by: M0ji | last post by:
I have a table with 10 records in it, and I have created a report and added existing fields. The report shows one record on each page (There are therefore 10 pages) I need all 10 records on one...
3
by: rahul2310 | last post by:
I have created joining letter in access 2010,as it is a letter it is not in column and row format. When i export report to word it does not shows report instead it shows column headings and data...
1
topher23
by: topher23 | last post by:
A layout provides a grouping method for controls on a form or report. The two default layout types are Tabular (labels in form header, controls in detail), and Stacked (labels to the left, controls...
10
by: mrijet | last post by:
hi everybody, how can I make advanced report in access 2010? Does I need to use lookup function in access to call the data from "FORM" to "REPORT". Actually I want to make it like a preview...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.