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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charting in Access 1

Status
Not open for further replies.

jdgreen

Technical User
Mar 21, 2001
144
0
0
US
I have a query a report is based on that takes dates from a form to set the date range. The criteria is:
Between [Forms]![frmPlantReports]![Text4] and [Forms]![frmPlantReports]![Text6]
When I try to create a chart that includes dates I get an error that the Microsoft Jet database engine does not recognize '[Forms]![frmPlantReports]![Text4]' as a valid field name or expression.
The query runs fine I just need to create a chart. Anyone have any ideas on this?

John Green
 
Set up variables such as PeriodFrom and PeriodTo as global variables. Then set these variables equal to your form selection in code behind the form. Set up two functions like below. Next in your query replace [Forms]![frmPlantReports]![Text4] with PerFrom() in your Between statement. Something like below. I use this type of charting and reports all the time. Good luck. Hope that helps.

PeriodFrom=[Forms]![frmPlantReports]![Text4]

Function PerFrom() As Date
PerFrom = PeriodFrom
End Function
Function PerTo() As Date
PerTo = PeriodTo
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top