Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using sql values to populate textboxes in Report Header

Status
Not open for further replies.

bubarooni

Technical User
May 13, 2001
506
US
I am having trouble populating some textboxes on a report that contains a chart. The textboxes are in the report header. When the report is opened the user is prompted to enter a StartDate and an EndDate. I have other reports that don't use charts that use these two values to populate two text boxes on the report so that the reader of the report can see what time period is covered. The chart seems to gooble up the values and all I get in the text boxes is '#Name?'. The same sql used in the chart report populates the fields correctly in a regular report. Here is the sql:

SELECT [RejClaim].[RejClaimReasonID], [Reason].[ReasonNum], Count([Reason].[ReasonNum]) AS CountOfReasonNum, [Reason].[Reason]
FROM Reason INNER JOIN RejClaim ON [Reason].[ID]=[RejClaim].[RejClaimReasonID]
WHERE [RejClaim].[RejClaimDate]>=StartDate And [RejClaim].[RejClaimDate]<=EndDate
GROUP BY [RejClaim].[RejClaimReasonID], [Reason].[ReasonNum], [Reason].[Reason];

Any hints or suggestions will be warmly appreciated.
 
I recommend that you don't ever use parameter prompts in queries. Try using references to controls on forms. It provides a much better experience for users and you can do so much more with the controls and a form.

You might want to review
Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Well, this is for rapid development, Monday in fact. I will look at your link though.

Thanks
 
If your report's record source doesn't return any records then you parameters are not available. Also, parameters for subreports or chart controls would require entering of parameters for every instance of the subreport or chart.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top