473,320 Members | 2,035 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,320 software developers and data experts.

Hide field(s) in Report

Cintury
81
Hello, I saw a similar thread on this subject but did not find the answer I was looking for.

I have a report that is used to find undistributed balances of food using a table and a subreport. It includes Date/Donor Company/Bakery/Dairy/Meat/Fruit/Veg/Prod/Prep'd/Bev/Non-Perish/Non-Food/Total

Under that if the "Cross-reference" button is selected it shows the Agency it was delivered to. (Same run through as above "Receiving Agency" instead of Donor Company)

After each pair it has a line that contains the "Undistributed Balance" if any. It simply takes the top donor amount, ex. 100 Bakery, and subtracted each value given to each corresponding agency.

What I want to do is have the report check the undistributed balance, and if it is zero(0) I don't want that Donor Company and its corresponding agency to be displayed. This will allow me to go ahead and re-distribute and balance each month at a glance. Currently it is only effective to view 1 day and 1 donor company at a time otherwise there is atleast 30 pages of report to scan through.

This is the coding under the "Detail" section of the report. (Where the undistributed balance line appears):

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

End Sub

Private Sub Report_Open(Cancel As Integer)
Dim strCriteria
On Error GoTo eh
If fcnIsFormOpen("fdlgPrintReports") Then
strCriteria = Nz(Forms!fdlgPrintReports!txtEnterBeginningDate, "") & IIf(IsNull(Forms!fdlgPrintReports!txtEnterEndingDa te), "", " Through " & Forms!fdlgPrintReports!txtEnterEndingDate)
Me.lblCriteria.Properties("Caption") = strCriteria
If Forms!fdlgPrintReports!optCrossRefReceipts = True Then
Me.rsubFoodDonationbyReceipt.Properties("Visible") = True
Me.txtUndistributedBakery.Properties("Visible") = True
Me.txtUndistributedBeverage.Properties("Visible") = True
Me.txtUndistributedDairy.Properties("Visible") = True
Me.txtUndistributedMeat.Properties("Visible") = True
Me.txtUndistributedNonFood.Properties("Visible") = True
Me.txtUndistributedNonPerish.Properties("Visible") = True
Me.txtUndistributedFruit.Properties("Visible") = True
Me.txtUndistributedVeg.Properties("Visible") = True
Me.txtUndistributedPrepared.Properties("Visible") = True
Me.txtUndistributedProduce.Properties("Visible") = True
Me.txtUndistributedTotal.Properties("Visible") = True
Me.lblUndistributedBalance.Properties("Visible") = True
Me.lblUndistributedBalance.Properties("Height") = 200
Me.lblCorrespondingReceipt.Properties("Height") = 200
Else
If Forms!fdlgPrintReports!fraInventoryOption = 2 Then
Me.rsubFoodDonationbyReceipt.Properties("Visible") = True
Me.txtUndistributedBakery.Properties("Visible") = True
Me.txtUndistributedBeverage.Properties("Visible") = True
Me.txtUndistributedDairy.Properties("Visible") = True
Me.txtUndistributedMeat.Properties("Visible") = True
Me.txtUndistributedNonFood.Properties("Visible") = True
Me.txtUndistributedNonPerish.Properties("Visible") = True
Me.txtUndistributedPrepared.Properties("Visible") = True
Me.txtUndistributedFruit.Properties("Visible") = True
Me.txtUndistributedVeg.Properties("Visible") = True
Me.txtUndistributedProduce.Properties("Visible") = True
Me.txtUndistributedTotal.Properties("Visible") = True
Me.lblUndistributedBalance.Properties("Visible") = True
Me.lblUndistributedBalance.Properties("Height") = 200
Me.lblCorrespondingReceipt.Properties("Height") = 200
Else
Me.rsubFoodDonationbyReceipt.Properties("Visible") = False
Me.txtUndistributedBakery.Properties("Visible") = False
Me.txtUndistributedBeverage.Properties("Visible") = False
Me.txtUndistributedDairy.Properties("Visible") = False
Me.txtUndistributedMeat.Properties("Visible") = False
Me.txtUndistributedNonFood.Properties("Visible") = False
Me.txtUndistributedNonPerish.Properties("Visible") = False
Me.txtUndistributedPrepared.Properties("Visible") = False
Me.txtUndistributedFruit.Properties("Visible") = False
Me.txtUndistributedVeg.Properties("Visible") = False
Me.txtUndistributedProduce.Properties("Visible") = False
Me.txtUndistributedTotal.Properties("Visible") = False
Me.lblUndistributedBalance.Properties("Visible") = False
End If
End If
Else
Me.lblCriteria.Properties("Caption") = ""
Me.rsubFoodDonationbyReceipt.Properties("Visible") = False
Me.txtUndistributedBakery.Properties("Visible") = False
Me.txtUndistributedBeverage.Properties("Visible") = False
Me.txtUndistributedDairy.Properties("Visible") = False
Me.txtUndistributedMeat.Properties("Visible") = False
Me.txtUndistributedNonFood.Properties("Visible") = False
Me.txtUndistributedNonPerish.Properties("Visible") = False
Me.txtUndistributedPrepared.Properties("Visible") = False
Me.txtUndistributedFruit.Properties("Visible") = False
Me.txtUndistributedVeg.Properties("Visible") = False
Me.txtUndistributedProduce.Properties("Visible") = False
Me.txtUndistributedTotal.Properties("Visible") = False
Me.lblUndistributedBalance.Properties("Visible") = False
End If

Exit Sub
eh:
MsgBox Err.Number & " - " & Err.Description & " From " & Err.SOURCE
Exit Sub
End Sub
Jun 7 '07 #1
2 4296
Cintury
81
It seems as though it should be only a few lines of coding please help :(
Jun 8 '07 #2
puppydogbuddy
1,923 Expert 1GB
It seems as though it should be only a few lines of coding please help :(

Cintury,
The code I gave you previously is very easy and works.....I will put the code in for you if you would just post the correct sub procedure that I need. The code you posted above is not the appropriate place to change the code. You provided the code for the open event of the report------->
Private Sub Report_Open(Cancel As Integer)

The code that needs to be changed is the code behind the button that calls the report open code above. If you can post the button click code, I will fix it for you.
Jun 14 '07 #3

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

Similar topics

8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
1
by: Sharon Frederick | last post by:
I was hoping to get an answer to the following problem. In a report that I run I get lots of duplicate fields when I only want to show one of each. I have said yes to the hide duplicates field and...
7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
1
by: Randy | last post by:
I built and employment report from the employment table. I then had to add a field to the table. I now need to add that field to the report. I can't seem to be able to do that by clicking on...
7
by: Darin | last post by:
I have a report that sub-totals on a group, then grand-totals at the report footer. If there's only one group, the sub-total and grand total are redundant, so I only want to show one of them. I...
5
by: ken | last post by:
Hi, Lets say you have a report with 10 rows. The first 4 of them have duplicate values in a given field. So you set the Hide Duplicates property to Yes and when you preview the report it shows you...
2
by: J.B. | last post by:
Greetings all - I have been working on this issue for a while now and it has been frustrating to the point where I'm reaching out to the gurus of .NET for any suggestions. I have a webform...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
1
by: MattGaff | last post by:
I have a parameter (dropdown menu) on my report which will filter or sort the data depending on the chosen option. There are only 2 options to choose from in this dropdown. I want to Hide duplicates...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.