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

Home Posts Topics Members FAQ

Blank Field Help?

I received this module from a BB on how to fix blank fields in a
report.
Here's the problem. I have this type of set up

Name: Account: Bal:
Comment1:
Comment2:
Comment3:
Comment4:
Comment5:
Comment6:

Every record has name, account and balance. Not every record needs a
response to each comment. How do i make Access include only fields
with data when making reports. The following program with given to me
but it has a "Run Time Error"

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ctl As Control
Dim blnNoPrint As Boolean
For Each ctl In Me.Controls
If ctl.Tag = "CheckIt" Then
If IsNull(ctl.Value) Then
blnNoPrint = True
Exit For
End If
End If
Next

If blnNoPrint Then
Me.MoveLayout = False
Me.PrintSection = False
Else
Me.PrintSection = True
End If
End Sub
Nov 13 '05 #1
1 1573
We'll need a little more detail to be able to help. Does every record have
name, account, balance, AND all 6 comment fields? Or are the comments in a
separate, related table as good normalized relational design would require?

If the labels on the report are attached to the comment fields, you should
be able to use the CanShrink property to shrink away both empty text boxes
and their associated label, without any code. Be sure to set the CanShrink
property of the Section, also, to CanShrink.

Larry Linson
Microsoft Access MVP
"Mike" <mb**********@aol.com> wrote in message
news:77**************************@posting.google.c om...
I received this module from a BB on how to fix blank fields in a
report.
Here's the problem. I have this type of set up

Name: Account: Bal:
Comment1:
Comment2:
Comment3:
Comment4:
Comment5:
Comment6:

Every record has name, account and balance. Not every record needs a
response to each comment. How do i make Access include only fields
with data when making reports. The following program with given to me
but it has a "Run Time Error"

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ctl As Control
Dim blnNoPrint As Boolean
For Each ctl In Me.Controls
If ctl.Tag = "CheckIt" Then
If IsNull(ctl.Value) Then
blnNoPrint = True
Exit For
End If
End If
Next

If blnNoPrint Then
Me.MoveLayout = False
Me.PrintSection = False
Else
Me.PrintSection = True
End If
End Sub

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
3
by: feel_free_to_spam_me | last post by:
Hi. I'm a sorta novice ASP programmer, so I sure could use some help from of you more experienced gurus.... I've written an ASP page that pulls all records from a table. My query is 'SELECT *...
19
by: Joe Scully | last post by:
Hi all, I am having trouble with access adding a blank record to a subform everytime I finish entering data and closing the form. (The form and subform are based on the one table) When...
6
by: MX1 | last post by:
Please help if you can. I have a form with an address field. There are 6 fields: Name1 Name2 Address1 Address2 CityStateZip Country
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
5
by: ChadDiesel | last post by:
My basic question is why does my print report button on my subform print a blank report when my cursor is on a blank entry line? Here is a more detailed explanation of my problem. I have a...
1
by: jason | last post by:
I've seen a few posts on this issue, but no clear solutions. I have a mulitiline textbox inside a datagrid. I use TemplateColumn to define as multiline with 3 rows. I have other field types...
0
by: visionstate | last post by:
Hi there, I have a form which has 2 text boxes, a combo box and a sub form in it (which reads from a query. The query reads from the table). On load, I would like the fields in the text boxes and...
4
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that...
19
by: billa856 | last post by:
Hi, I have to use the table(PRODUCTION) already generated in MS Access in which all fields are of TEXT type.fields like (orderdate,palletno,customercode,itemno,pono,carto n,pcs,totalquantity)Now i...
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
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,...
1
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...
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?

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.