Report with subreport: one to many

G

Guest

Hello,

I have a report which uses a subreport. When I run the report, I get "Enter
Parameter Value" error message for "tblGuestRoom". I click ok and the
report seems to work fine.

I have narrowed down this error to the Link Master Fields property setting,
because when I try the same thing with Forms, I get error: 'The Link Master
fields property setting has produced this error: The object doesn't contain
the Automation object 'tblGuestRoom'. This error happens when I try to
scroll to 'Next Record' from Window 2 (when in reality, there are only 2
windows for the given room). I think the problem lies right here. Perhaps I
didn't set my relationships up correctly, or Link Master, and it doesn't know
the one-to-many relationship?? (although seems to be displaying fine).

Here is the picture of how things are set up:
--Main report is "rptReport1". RecordSource is "qryQuery1", which uses 2
tables: tblGuestRoom, the table coming up in the error, and tblBathroom.
They both have primary key of RoomNumber.
--Subreport is "rsubReport1", with RecordSource = tblWindow. From
tblGuestRoom to tblWindow is a one-to-many relationship, on key RoomNumber.
The idea is to display one report page per room number, with the subreport
displaying window 1, window 2, etc.
--On main report, properties for subreport are as follows: SourceObject =
the subreport. Link Child Fields=tblBed.RoomNumber, Link Master Fields=
tblGuestRoom.RoomNumber. In Relationships, there is a 1 to many relationship
between tblGuestRoom and tblBed. Does the subreport know this, or do I need
to tell it that somehow? Where do I tell it this? I suspect that this is
where my problem lies.

Thank you in advance for any help,
Lori
 
D

Duane Hookom

I would first make sure that your main report's record source has only one
copy of the file RoomNumber. Then change the Link Master property to only:
RoomNumber
 

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