- Jan 21, 2005
- 17,722
- 6
- 81
Hello again everyone...
This time around, I'm trying to get a form work with a report. This database houses the information for many volunteers and keeps track of their hours.
I have created a form that allows you to select the volunteer from a combo box. At that point, you click on "Generate Report" and it will generate a report containing the dates they worked, how many hours, and what activities were performed. Right now, I can't get the report to load properly.
The report is based off of a query that prompts you to enter their ID number. The query will then return all of that information for that particular volunteer. Then, this information is placed into a report for formatting purposes.
Right now, the connection between the query and the form isn't happening. I click on my volunteer's name and click "Generate Report", and then it prompts me to enter the volunteer ID (not desired, supposed to be pulled from the combo box which contains their ID). Even if I enter a valid ID, it will generate an empty report.
Here is the SQL for the query:
SELECT Volunteer.[Volunteer-ID], Volunteer.[Volunteer-First-Name], Volunteer.[Volunteer-Last-Name], DateWorked.[Date-Worked-Date], DateWorked.Hours, DateWorked.Activity
FROM Volunteer INNER JOIN DateWorked ON Volunteer.[Volunteer-ID]=DateWorked.[Volunteer-ID]
WHERE Volunteer.[Volunteer-ID]=[Choice];
Here is the code after clicking "Generate Report" button:
DoCmd.OpenReport "Individual Volunteer Report", acViewPreview, , "Choice" = listVolunteer.Value, acWindowNormal
In the above "DoCmd..." code, listVolunteer.Value should return their volunteer ID, and has been doing so correctly. I confirmed this by using a breakpoint during debug.
Thanks...hope you guys can help this time around!
This time around, I'm trying to get a form work with a report. This database houses the information for many volunteers and keeps track of their hours.
I have created a form that allows you to select the volunteer from a combo box. At that point, you click on "Generate Report" and it will generate a report containing the dates they worked, how many hours, and what activities were performed. Right now, I can't get the report to load properly.
The report is based off of a query that prompts you to enter their ID number. The query will then return all of that information for that particular volunteer. Then, this information is placed into a report for formatting purposes.
Right now, the connection between the query and the form isn't happening. I click on my volunteer's name and click "Generate Report", and then it prompts me to enter the volunteer ID (not desired, supposed to be pulled from the combo box which contains their ID). Even if I enter a valid ID, it will generate an empty report.
Here is the SQL for the query:
SELECT Volunteer.[Volunteer-ID], Volunteer.[Volunteer-First-Name], Volunteer.[Volunteer-Last-Name], DateWorked.[Date-Worked-Date], DateWorked.Hours, DateWorked.Activity
FROM Volunteer INNER JOIN DateWorked ON Volunteer.[Volunteer-ID]=DateWorked.[Volunteer-ID]
WHERE Volunteer.[Volunteer-ID]=[Choice];
Here is the code after clicking "Generate Report" button:
DoCmd.OpenReport "Individual Volunteer Report", acViewPreview, , "Choice" = listVolunteer.Value, acWindowNormal
In the above "DoCmd..." code, listVolunteer.Value should return their volunteer ID, and has been doing so correctly. I confirmed this by using a breakpoint during debug.
Thanks...hope you guys can help this time around!
