REPOST: Print Blank Record followed by all records

  • Thread starter Thread starter Steven Craig Basham
  • Start date Start date
S

Steven Craig Basham

I have a report with a sub-report in it. How would I go about printing the
sub-report with a blank record for each field in the query followed by any
records that may exist.

For example, I would like to see the following:

Query Fields:
FirstName,City,State,ZIP
Query resultant data:
Steve, Indianapolis, IN, 46060

Report result:
FirstName, City , State , ZIP
<Blank> ,<Blank> ,<Blank>,<Blank>
Steve , Indianapolis, IN , 46060

I added a 'Blank' record to each table I need to do this in, but it's
already resulting in users thinking that a new one to edit, etc... I hate
that way. I believe I need to do this programmatically. Any help would be
greatly appreciated.

Thank you,
Steven Craig Basham
 
Why not just include the <blank> stuff in the reports header?

You have got FirstName "tags" etc in the reports header....so just expand
the room for the heading...and put in the the <blank> stuff.

That way..you can delete the record in the database....
 
Why I didn't see the obviously simple solution is beyond me. Can't see the
forest for the trees... LOL. Seriously, though, if anyone DOES know how to
programmatically print blanks for fields in an empty recordset, I would love
to know how for future reference!

Thank you so much.
 
Hmm.... that works if there is already a record in the query result... but
even the reports header is omitted if there are no records at all... should
I be using the ON NO DATA event?
 
Actually, you could fake the data for the record.

If you wanted to make a report run with NO reocrdset at all, you could do
the following:

Lets pretend we want to print 0 to 15 on the report. Nothing else.

In the reprots module, we go:
Option Compare Database
Option Explicit

Dim intMaxRec As Integer
Dim intRecCount As Integer

In the reports on-open, we go:

Private Sub Report_Open(Cancel As Integer)

intMaxRec = 15
intRecCount = 0

End Sub

In the reprots detail section we place a un-bound text box Text0....we go:

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

Me.Text0 = intRecCount

intRecCount = intRecCount + 1

If intRecCount <= intMaxRec Then
Me.NextRecord = False
End If

End Sub

Note how we go me.NextRecord = false.

So, I am thiinking in the format event, you simply sutff values ("<blank>")
for the first rocrd. Then do a me.nextrecord = false.

if intRecCount = 1 then
me.Firstname = "<blank>"
me.LastName = "blank">
me.nextrecord = fasle
endif

Note that the above code will only run ONCE....

I have not tired the above idea with a bound report...but the above may very
well work...
 
Back
Top