473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Remove Null fields from reports?

26 New Member
Hi All,


I am using ms access 2007/windows Vista

I am trying to generate a report for a printing company based on the quote prepared for a client.

in the report, i want to include only the fields which are has an entry and exclude the rest.

i was wondering is it possible to create a report to acheive this.


as of now, i have all the fields in the report ,based on a parameter query.

need someone's assistance..


chuz,
Asle
Nov 1 '07 #1
1 2658
nico5038
3,080 Recognized Expert Specialist
Not sure which fields you want to hide, but I did once create a function to dynamically fill fields on a report for a crosstable query.
Such a query can have a different number of fields and perhaps it's suitable for you to use.

Making the columnheader and detaildata flexible is possible, but needs some VBA code in the OpenReport event.

To start, doing this you need to place the fields "coded" in the report.
The column headings should be called "lblCol1", "lblCol2", "lblCol3", etc.
The "detail" fields should be called "Col1", "Col2", "Col3", etc.

The report query has two rowheader columns and a Total column, therefor the first field is effectively column 4 (count starts at 0 so I used intI=3) but this could differ for you.

Make sure that the number of Columns is not bigger as the number placed. The programcode has no protection against that !

The OpenReport code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Open(Cancel As Integer)
  2. Dim intI As Integer
  3.  
  4. Dim rs As Recordset
  5.  
  6. Set rs = CurrentDb.OpenRecordset(Me.RecordSource)
  7.  
  8. 'Place headers
  9. For intI = 3 To rs.Fields.Count - 1
  10. Me("lblCol" & intI - 1).Caption = rs.Fields(intI).Name
  11. Next intI
  12.  
  13. 'Place correct controlsource
  14. For intI = 3 To rs.Fields.Count - 1
  15. Me("Col" & intI - 1).ControlSource = rs.Fields(intI).Name
  16. Next intI
  17.  
  18. 'Place Total field
  19. Me.ColTotal.ControlSource = "=SUM([" & rs.Fields(2).Name & "])"
  20.  
  21. End Sub
  22.  
The report query has two rowheader columns and a Total column, therefor the first field is effectively column 4 (count starts at 0 so I used intI=3) but it could differ for you.

Nic;o)
Nov 2 '07 #2

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

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
6
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that...
2
by: Darryl Kerkeslager | last post by:
As the subject above hopefully makes clear, I want to do several reports, "with lots of fields not otherwise in database". These reports also have variable-length text. I have defined the...
1
by: civa | last post by:
Hii, I have created a check writing program which consists of a table name "DATA" with fields CHECKNO, CHECKDT, BANKNAME & AMOUNT & also a query with date criteria with the above fields. I have 2...
1
by: Rolan | last post by:
I need to be able to remove <BR>'s that are placed in null fields (Access 97) for blank records when doing html imports. Of course, Access does not recognize the html tags and are invisible. Aside...
5
by: Robert Zurer | last post by:
I have a large pool of business objects all referencing one another in various ways. In the client application I want to do something like employee.Delete(); Behind the scenes, I want to...
3
by: Simon | last post by:
Dear reader, I found out a strange behaviour in a query of the type Total (summation query). In case of a normal select query with a criteria setting Is Null for field-A, four (4) records...
10
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have the following three files. 1. Users.aspx is a webpage that uses the <asp:ObjectDataSourcecontrol to populate a simple <asp:ListBoxcontrol. 2. The UserDetails.cs file creates a Namespace...
6
by: falconsx23 | last post by:
I am trying to write a code for a Phone Directory program. This program is suppose to allow the user to enter a name or directory and then program can either add, save or even delete an entry. Also...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.