How do I add dummy records to a subreport?

N

Nyx37

Hello,
I have a report for printing Security Incident Reports. On the first page
there is a fixed three slots for up to three people. I need to have all
three slots print even if there are less than three people in the incident.
I have the data for people stored in a subtable. Any ideas are welcome.
Thank you
 
D

Duane Hookom

I would create a ranking column in the subreport's record source to number
the "people" records 1, 2, & 3. Then I would create a table of numbers with
numbers 1, 2, & 3. Add this table to the subreport's record source with a
join that includes all the records from the table of numbers. This will
assure there are always 3 records in the subreport.
 
N

Nyx37

Duane,
I'm not sure what you mean. Could you elaborate a little more. This may
help.
The table fields look like this: SIRid, PersonNo, FirstName...... The
incident report is alowed to have more than 3 people but the PersonNo > 3
will be on another page at the end of the report.
Thankyou for your responses
 
D

Duane Hookom

There are a large number of posting regarding ranking queries that would
number your persons records from 1 to whatever for each SIRid which I expect
is your foreign key to your main table.

If you can't find info on a ranking query, come back with your table and
signficant field names as well as data types.
 
N

Nyx37

Duane,
I'm not sure what you mean by ranking query. the table look like this:
SIRid - text (Foreign key)
PersonNo - byte (I think this may be the ranking field)
PersonType - Byte (1= Patient, 2= Visitor, 3= Staff, 4= Other)
PCReportingParty - Yes/No
 
D

Duane Hookom

What types of values are stored in PersonNo? Are these numbered 1,2,3,...? If
so you should be able to subtract 1 and integer divide by 3 to group your
persons into groups of 3

GroupNum:([PersonNo ]-1)\3
 
N

Nyx37

Duane,
I don't think we are on the same page. Perhaps I have failed to express
myself well. In the incident report, if there are less than 3 persons, I
need to add blank records untill it reaches 3 records. So, if no people
exist in an incident report, I need to add 3 blank or dummy records to the
sub report. The fields SIRid and PersonNo can contain data in dummy records.
Also I do not want to add any records to the actual table.

Duane Hookom said:
What types of values are stored in PersonNo? Are these numbered 1,2,3,...? If
so you should be able to subtract 1 and integer divide by 3 to group your
persons into groups of 3

GroupNum:([PersonNo ]-1)\3
--
Duane Hookom
Microsoft Access MVP


Nyx37 said:
Duane,
I'm not sure what you mean by ranking query. the table look like this:
SIRid - text (Foreign key)
PersonNo - byte (I think this may be the ranking field)
PersonType - Byte (1= Patient, 2= Visitor, 3= Staff, 4= Other)
PCReportingParty - Yes/No
.
.
.
PCSuspect - Yes/No
FName - text (First Name)
LNmae - Text (Last Name)
RAddress - Text (Resadence Address)
BAddress - Text (Bussness Address)
Phone1 - Double
Phone2 - Double
Discription - Text


The sub report's SQl is: SELECT * FROM tblSirPeople WHERE PersonNo < 4
The Master-Child fields is SIRid.

I need the 1st Page of the Master report to print 3 Person Blocks even if
there are more or less people than three. In other words, if there are no
people, for what ever reason, I need the report to print three person blocks.
Currently I have the lines, boxes and labels on the master report with a
subreport on top. I don't like this set up. It seems shaky to me. The
SIRid and PersonNo fields do not print (They only exist for ranking and
linking)

thanks
 
N

Nyx37

I think I figured it out. In the subreport's open event, I perform a DCount
to see if 3 people exist and if they don't I add records to a temp table and
join them with a union sql.

Nyx37 said:
Duane,
I don't think we are on the same page. Perhaps I have failed to express
myself well. In the incident report, if there are less than 3 persons, I
need to add blank records untill it reaches 3 records. So, if no people
exist in an incident report, I need to add 3 blank or dummy records to the
sub report. The fields SIRid and PersonNo can contain data in dummy records.
Also I do not want to add any records to the actual table.

Duane Hookom said:
What types of values are stored in PersonNo? Are these numbered 1,2,3,...? If
so you should be able to subtract 1 and integer divide by 3 to group your
persons into groups of 3

GroupNum:([PersonNo ]-1)\3
--
Duane Hookom
Microsoft Access MVP


Nyx37 said:
Duane,
I'm not sure what you mean by ranking query. the table look like this:
SIRid - text (Foreign key)
PersonNo - byte (I think this may be the ranking field)
PersonType - Byte (1= Patient, 2= Visitor, 3= Staff, 4= Other)
PCReportingParty - Yes/No
.
.
.
PCSuspect - Yes/No
FName - text (First Name)
LNmae - Text (Last Name)
RAddress - Text (Resadence Address)
BAddress - Text (Bussness Address)
Phone1 - Double
Phone2 - Double
Discription - Text


The sub report's SQl is: SELECT * FROM tblSirPeople WHERE PersonNo < 4
The Master-Child fields is SIRid.

I need the 1st Page of the Master report to print 3 Person Blocks even if
there are more or less people than three. In other words, if there are no
people, for what ever reason, I need the report to print three person blocks.
Currently I have the lines, boxes and labels on the master report with a
subreport on top. I don't like this set up. It seems shaky to me. The
SIRid and PersonNo fields do not print (They only exist for ranking and
linking)

thanks

:

There are a large number of posting regarding ranking queries that would
number your persons records from 1 to whatever for each SIRid which I expect
is your foreign key to your main table.

If you can't find info on a ranking query, come back with your table and
signficant field names as well as data types.
--
Duane Hookom
Microsoft Access MVP


:

Duane,
I'm not sure what you mean. Could you elaborate a little more. This may
help.
The table fields look like this: SIRid, PersonNo, FirstName...... The
incident report is alowed to have more than 3 people but the PersonNo > 3
will be on another page at the end of the report.
Thankyou for your responses

:

I would create a ranking column in the subreport's record source to number
the "people" records 1, 2, & 3. Then I would create a table of numbers with
numbers 1, 2, & 3. Add this table to the subreport's record source with a
join that includes all the records from the table of numbers. This will
assure there are always 3 records in the subreport.
--
Duane Hookom
Microsoft Access MVP


:

Hello,
I have a report for printing Security Incident Reports. On the first page
there is a fixed three slots for up to three people. I need to have all
three slots print even if there are less than three people in the incident.
I have the data for people stored in a subtable. Any ideas are welcome.
Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top