passing record set into
RH

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » Passing a record set into a graph to display on a form

Passing a record set into a graph to display on a form

resolvedResolved · Medium Priority · Version 2016

Manny has attended:
Access Intermediate course
Access Advanced course

Passing a record set into a graph to display on a form

Hi Guys,

I have obtained a recordset from a select query using my vba code. I am attempted to put this onto a subform but have no luck. I have tried various attempts. Please could you help?


'/// display results in graph
Set qdef = dbs.QueryDefs("ViewHistoricalPriceSubformGraphQ")
qdef.Parameters("[Enter ISIN]") = subfrm.Recordset(1)
qdef.Parameters("[Forms]![EnterFundF]![Combo8]") = [Forms]![EnterFundF]![Combo8]
Set rst = qdef.OpenRecordset

With Forms![ViewHistoricalPriceSubformGraphQF].[Graph28]
.RowSource = rst
.Requery
End With






Manny

RE: Passing a record set into a graph to display on a form

Hi Manny,

Thank you for the forum question.

You want if something is selected in a combobox to query the data based on the selection and display the result in a charts in a subform. Is this what you want?

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Passing a record set into a graph to display on a form

Hi Jens,

Thanks for your reply. Not quite - I have a query with 2 parameters. I wish to select the data and then this to be displayed on a graph as a subform.

is there any other information i can provide?

Manny

RE: Passing a record set into a graph to display on a form

I figured it out!

RE: Passing a record set into a graph to display on a form

Hi Manny,

I am sorry but I cannot help you with this one. I have tried with SQL, I have tried reference a recordset, I have spent a lot of time Google the issue, but it has not been possible to find a solution.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Passing a record set into a graph to display on a form

No worries Jens, I appreciate your help. I resolved it by setting up a query as the control source for the graph on a subform. this way whatever values are populated by the query are automatically fed into the graph :)

I do have one last query on this subject. In order to scale the graph accordingly, i need to get the maximum and minimum value ffrom the select query. the data is laid out like this..

[date] , [price1], [price2], [price3]

I would like to get the absolute maximum value and the minimum value of the entire query and then scale the graph accordingly. Currently using inputting boxes to manual type the scale, is there a way to get this from the query and then input into the iMax and iMin?

Private Sub Form_Load()

Dim iMax As Integer
Dim iMin As Integer

iMax = InputBox("Enter y-axis max")
iMin = InputBox("Enter y-axis min")

Me!Graph45.Axes(2).MaximumScale = iMax
Me!Graph45.Axes(2).MinimumScale = iMin

End Sub

RE: Passing a record set into a graph to display on a form

Figured this out too! i used Dmax and DMin and then wrote a function to get the maximum and minimum of each field of these

RE: Passing a record set into a graph to display on a form

Thank you letting me know.

Well done.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Wed 29 Aug 2018: Automatically marked as resolved.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

How To Display An '&' In A Label In A Form

To have your label display a sentence with an &(ampersand) in it, like Fox & Hound simply type it as:

Fox && Hound

View all Access hints and tips


Server loaded in 0.05 secs.