Charts from Select Query - Fields not recognized

S

shane

When using a select query as the source for a chart I am getting an error
that the date ranges are not recognized by "jet". I haven't a clue as to
what that means.

The criteria for the dates are sourced from two unbound text fields on a
form that default to the first and last day of the current month respectivel.
Each is formatted as "mm/dd"yy". The criteria in the query for the field
"main!date" is "between forms!formname!sdate and forms!formname!edate".
"sdate" and "edate" are the names of the unbound text fields.

To get around this I changed the select query to a mktable query and use the
table as the source for the chart. The table which is deleted and refreshed
when the database is open is causing more annoynaces. I have no desire
whatsoever to maintain this method of creating the charts.

Any assistance in making the charts to function as intended with a select
query is much appreciated.

If I must however use the mktable solution then I'd appreciate some help
forcing the macro to continue on if the table it's looking to delete doesn't
exist.

Thanks,
Shane
 
M

Mark Andrews

I too had issues with using any criteria such as Forms!fromname!sdate with
charts on reports. I'm not sure if there is a way past this or not???

My solution was to just recreate the query which drives the chart in code.
Using a querydef and replacing the sql. I'll try and remember the code (it
could be a little off hope you get the idea)

strsql = "select ...... where startdate < " & Me.txtStarteDate .............

Set qd = Currentdb.OpenQueryDef("qryGraph")
qd.sql = strsql
qd.close

Exit_ButtonClick
Set qd = Nothing

Then just base the chart on qryGraph

Definately don't use make table queries and temp tables!

HTH,
Mark
 

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