Help with printing a report

B

Bob

I have a Query that has , OwnerName, ID and Horse,ID
I want to have A Combo Box that selects OwnerName then prints a report that
prints the Horses Names
Thanks for any Help....Bob
 
A

Arvin Meyer [MVP]

You may not have it set up this way, but 1 owner can have many horses, and
I'm pretty sure that 1 horse can have many owners, assuming that these can
be race horses that can be owned by a consortium.

If it's not set up that way and you have 1 owner to many horses, the report
can be built in multiple ways:

1. You can have the detail section have both the owner and horse sorted on
owner and hiding duplicate owners
2. You can have a owner in the detail section and a subform with all his
horses.
3. You can Group on owner and have the horses in the detail section.

In any case the systax to open the report for 1 owner would be:

DoCmd.OpenReport "ReportName", acViewPreview, , "OwnerID ='" & Me.cboOwners
& "'"
 
B

Bob

Thanks Arvin ,what would I have to do to filter one owner out in a drop down
combo to select the Owner and his horses to print on the report....Thanks
Bob
 
B

Bob

Sorry Arvin, couple of questions
Should I make another Query for Owners name so as I wont get Owner name 15
times if he has fifteen horses
This code should it be in the Event/AfterUpdate of my Combo Box
My report name is rptOwnerHorse
My Combo Box cbOwnerHorse
Which has RowSource: SELECT qryOwnerHorse.OwnerName,
qryOwnerHorse.tblOwnerInfo_OwnerID FROM qryOwnerHorse;
Thanks Bob
 
B

Bob

Arvin I have a list box with all the owners and a button with this script,
what do i have to have at the end of the script?
And Can I not have multiple names the same in list box?............Thanks
Bob

Private Sub Command20_Click()
DoCmd.OpenReport "rptOwnerHorse", acViewPreview, , "OwnerID ='" &
Me.lbOwnerHorse
& "'"

End Sub
 

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

Similar Threads


Top