I have a form called OwnerForm. It contains a combo box called
Owner. The combo box looks up names from a table called OwnerName.
It contains fields called OwnerID and Owner. I also have a main form
called ProjectsForm. This form has several fields to enter data. I
have a query that is called Owner Query. This query contains the
fields IDNumber.Projects2 Team.Projects2 and Owner.OwnerName getting
information from tables.
On the criteria of Owner I have:
forms!OwnerForm!Owner.
I want the query to only show the data from the Projects2 table that
matches the name on the combo box. I made a report called Owner
Report. I have a command button on the OwnerForm form which opens the
report in Preview. I can't seem to get the report to show any data.
It is a blank report. When I open the report from the form it is
blank. When I open the report from the report list it sends me to the
form I choose the name from the combo box then click on the command
button, it prompts me to a Enter Parameter Value. When I type in a
name it will generate the report with the proper information, but I
want the combo box to send it to the report and not have to type it
in. The record source for the report is
SELECT [OwnerName].[Owner], [Projects2].[ID Number], [Projects2].
[Team] FROM OwnerName INNER JOIN Projects2 ON [OwnerName].
[Owner]=[Projects2].[Owner] WHERE ((([OwnerName].[Owner])=[forms]!
[OwnerForm]![Owner]));
I also have the report open and close events as follows: It seems to
work ok.
Private Sub Report_Close()
DoCmd.Close acForm, "Owner Report"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "OwnerForm", , , , , acDialog
Any ideas would be appreciated.
End Sub