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

Graphs in Access 97- Desperate

Status
Not open for further replies.

qureshi

Programmer
Mar 17, 2002
104
AU
Hi,
My program runs a "select into" query to make a temporary table. From this temporary table I then create a graph.

When I run the query on its own, it runs fine a produces the temp table. But when I open the form I get the following error '[Format[[Date]"DDDDD"]]

When I initailly designed the program all was working fine. It all happened when I was demonstrating the package to my boss -- what a day it was.

I havent changed any setting on my computer and I cant figure out what has gone wrong. Urgent Help is required.

Thanks
 
Let's see some code...

VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Thers isnt much code. I am using the access macro to do the job. Anyway thats what I have

Set db = CurrentDb
On Error Resume Next
db.TableDefs.Delete "tpperiod"
DoCmd.RunMacro "specific period chart"
db.Close
 
Convert your macro to a vb code module and post it. Also, the code above being kicked off by what event? Also, the query in question, can you convert it into a SQL and post it as well?


Vbajock

Gainfully employed in Houston, TX
 
The macro has four steps
1.Set Warning off
2.Open query. Which is listed below:

SELECT Details.Name, Details.Date, Details.Type, Details.qty, Details.Passed INTO tpperiod
FROM Details
WHERE (((Details.Date) Between [Enter Start Date] And [Enter End Date]))

3.Open form. Which is just a form with a chart inserted on it.
4.set warning off

On the main form there is a button which when clicked starts the macro

I hope that helps

Thanks
 
It sounds like it has to be something in the load event since the query won't run until the button is clicked. Have you checked for missing references?

VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
I agree on the reference check. Was your test to your boss on a different machine from the one you used to develop? Chart is a real squirrelly animal. I know when we upgraded from 97 to 2000 I had to delete and re-create the chart objects in a few apps.
 
The test was carried out on the same machine. The following references are checked

Visual basic for applications
Microsoft Access 8.0 object library
Microsoft DAO 3.51 Object Library.

There is no reference to any missing references.
 
VBSlammer was right
try ticking ""Microsoft Graph 8.0 "" it would prob help


Hope this helps
Hymn
 
Added the reference. Recreated the graphs. Same PROBLEM
 
poss a problem with
'[Format[[Date]"DDDDD"]]
what date? where is date? which date? where is the format code?


Hope this helps
Hymn
 
Hymn:
The query has been created in Access 97. The SQL equivalent (which access provides) in listed is listed above. The query runs fine. It produces the temp table but when the graph tries to load the data from the temp table the error is generated.
 
I can't reproduce this error. I would be looking at the data in the temp table to see if it is valid.

Try adding:
Code:
  CDate([Date])
to any references to the [Date] field to make sure the data is explicitly converted to a valid date.

Sometimes you can run into ambiguity problems when you name a field the same as an intrinsic constant or function name such as "Date" - try renaming your date field with something else like "OrderDate" or whatever.


VBSlammer
redinvader3walking.gif

Unemployed in Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top