MS Access: Add data to Chart programatically from Visual Basic - vb.net

I'm looking someone who can help me with this issue, that seems very easy to achieve but there is no much information around the internet.
I'm working with MS Access and Visual Basic, and I would like to create a simple bar graph, giving params that I've already gathered from many querys.
In this case: A chart about Litres per Week. I have a query to gather the amount of litres of 4 different weeks. I also provide the information for the X Axis (Last week, Last two weeks, and so on.. ). It would look like this:
So I'm wondering if this can be done, as well a pie charts and line charts.
I'm aware that this can be easilly done with Excel, but I don't want open another program to read information.
Thank you very much.

How to make Charts in MS Access would be my first key word search :)
Then I will check on MSDN for proper tools/properties availability/updates on software and so on.
Here is a simple basic tutorial to follow
This is the entire google search that would provide you anything you want to check on the topic.
Please note the version of MS Access you are using against the tutorials described. In certain versions there are certain changes have been done to the software itself. You are much lucky if it's not 2007...
EDIT Based on the comments with OP:
Since OP has exhaustive/heavy queries, it's recommended to create a temp table based on the final query.
Then temp table can act as a view and become the data source for the Chart
dynamic binding of chart from database in VS2010 in C#
Bind query as a datasource to MS Access chart. There is a method called databindtable which is a chart property. You may use it:
e.g. chart1.DataBindTable(yoursource,columname)
This article provies a good sample code.

Related

MS Access Modern Charts - VBA adding trendline

I would like to use VBA to format MS access modern charts in forms, for example adding a trendline, turning on data labels etc. I have searched but cannot see any methods or data structures to do this. Can anyone point me in the correct direction?
This may give you what you want.
https://www.youtube.com/watch?v=0QADS5XxVIs&ab_channel=Microsoft365
Keep in mind...Access is a NOT a great tool for creating charts. As an alternative, you may want to import your data into MS Excel, from Access, and create your Trend Line in Excel. There are so many ways to move data between Access and Excel, back and forth, so if you get stuck with one app, just switch to the other app!

RDLC Report Datasets/Tables and Custom Code

I've been given the task of updating some rdlc reports which I've never used before. Some of the more complex reports can have multiple datasets where each SQL query is over 10kb of text if copied to a text editor. I'm finding it difficult to wrap my head around some of the more complex SQL.
I've found that I can add custom VB code to the report and I was thinking it would be nice if I could use a simpler query for the dataset and then do some processing with custom code that could populate an empty table in the report. I haven't been able to find any examples of anything like this so I'm wondering if it's possible? If so, can anyone please give me a basic example of reading data from a dataset and adding rows to a table using custom code?
Thanks!

Intuitive auto-population of data between two worksheets

I have two excel tables. One is a list of names with a calendar that tracks number of days traveled and puts it in percentage. The other table shows proposed travel schedules for the same list of people but in a different format. I have to manually find their percentage in table 1 and input them to the second table for presentations. I want to develop something that reads the names in both tables and can copy their travel time percentage into the second chart. Maybe adding it in the cell or to a blank row below. I have been unable to find any previous threads relating to this. I am new to programing and do not know if this can be done in VBA macro for excel. Does anyone know what functions I could use to accomplish this?
The quickest way is to use powerpivot. You'll have to look at your version of excel to see how to access it. For instance, powerpivot is included and preset in excel 2016, and is a free add-on you'll need to download for excel 2010.
You can uplaod both those tables into the powerpivot model, define the relationship between the two tables (as simple as dragging the relationships in a diagram view). Then you literally have a pivot table that connects both and you can create a measure that does what you're saying. The plus is that there's so much more you can do!
Hearing how your data is set up if you run through a powerpivot table tutorial you might even rethink your data set-up. The advantage is you don't need to learn vba just learn to apply your current and new excel skills. A good starting point is here:
https://msdn.microsoft.com/en-us/library/gg413497(v=sql.110).aspx
There are also 5 min youtube clips that'll give you a good idea of what else you can do with it.

Vb.net - array, database or sql

I'm making my project for a-level computing and I reached a problem that im not sure how to solve. Im making something similar to a student information management system and I want a way to store a small list of students maybe 5 to 10 preferably in my program and make reference to them from all forms and so that if something is changed on one of the students maybe a piece of information, that these information is carried to the next form. My teacher has very little knowledge on programming and so im kind of stuck, i have no previous experience with databases or sql however if someone is willing to break it down ill be very grateful and ive got a good understanding of arrays. My deadline is the 10th of may so asap please, thanks
- kyle
If you prefer simplicity I would stick to a CSV file or XML. I found a website which an end-to-end tutorial on how to create the XML and add items (students) to it using VB.net as according to your tag. You need only after to read them from the file, but might just as well add new:
http://vb.net-informations.com/xml/how-to-xml-in-vb.net.htm
I would stick with XML (or CSV as preffered) as it is a text file basically so you can see and make changes directly if needed.

T-SQL Pivot - Pivot on all rows programmatically

Situation
I have a report which is to be export by customers to excel format when they please that must meet certain formatting criteria.
Problem
This report is a statutory return that must be returned in a specific format. I have decided this can be achieved with the use of pivots. Instead of a list view they require a grid of totals, like this
o...
This can be done manually by writing out lots and lots of pivots in a big complex statement, but would need to be updated as soon as the column I am pivoting on has a new entry, which will be frequent.
Perfect Solution
The perfect solution for this would be for somebody to find something magical that automatically pivots on all data in one column and does so programmatically, so if entry's are added to that column, they will also be pivoted on.
I am not looking for exact code here because that's lazy and I won't learn anything. A shove in the right direction would be nice though, if this is at all possible.
You can do this with dynamic SQL (Example in this answer). Although this is frequently best achieved through an application/reporting layer rather than directly in SQL.
In your case you can embed reports in Windows Forms Applications, which gives the option of just viewing the report, or exporting in a number of formats. If the pivot needs to be done in SQL then dynamic sql is the only way to do it.