I had similar problem with Access. I found out that if you are using MS Graph, you can have multiple line ONLY if you are using the same x-axis for all your lines (so you can't have 200 data for year 1 and then 500 for year 2, it has to be the same).
The way I found to make it work was to...
Have a look on this thread http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=35457 . I had a more or less similar problem. Maybe this will help, maybe not. I have no other idea.
change this line: Me.Visible = True for Reports(ReportName).Visible = True
You can also change this line: [Forms]![frmChanges].Visible = False for Me.Visible = False, it will fasten up your code (but you probably won't see the difference)
I had a LOT of problems with chart but I was able to resolve all of them... Are you using Microsoft Chart or Excel to build your charts? Which version of Access are you working with? If you do have code, can you put it so I can have a look at it? I have many questions but no answer for now...
If somethnig like this still doesn't work, can you put your code?
DoCmd.OpenReport SubreportName, acViewDesign
With Reports(SubreportName)
if Reports(MainReportName).MainTextBox.value = "" then
.TextBox.visible = false
.TextBox.ControlSource = ""...
I presume that your combobox is taken its value from a table? If so, just set the default value properties of that combobox to the first value present in your table...
What is exactly your expression in the report?
Is it a textbox (probably)?
If so, How do you write this expression in the report?
With a macro or with VB?
To have the properties set to text for a textbox make sure you have the ". For example, set your control source to :
="Try some...
You need some VB code for this:
if Reports("ReportName").TextBox.value = "" then
SubreportComponents.visible = false
else
SubreportComponents.visible = true
end if
Your x-axis will be the months and your y-axis will be the data for each of your years... If you have the same number of data for each year, you can use microsoft graph included in access. If not, you'll have to use Excel (automation).
Change those two lines:
Dim rs As Recordset
Set rs = Me.RecordsetClone
For this:
Dim rs As Object
Set rs = db.OpenRecordset("RecordsetClone")
Also, check the available options for OpenRecordset.. It should work fine
Well, thanks for your advice.
When I said "graphs from excel" I mean that I have a subreport that contains an OLEObject representing an Excel chart. So basically, the graphs are generated FROM access but WITH Excel... The chart option in Access is not enough evolved for my needs.
There is...
Well I finally found out how to solve this particular problem... Very stupid indeed but it works: I simply close my report and reopen it with VB... Thanks for your help.