By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Blank Field Help?

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.