Access Database - Display different data - database

Good morning everybody, this is the first time I write in this forum so, i'm sorry if I do some error!!!
I'm working on a project in Visual Studio where I'm connecting to an Access Database. The most important thing is that this Database is not mine and I can't modify it because it is updated daily by another automatic software.
I have to think that this database is "Read Only".
This database only has tables with primary key but there are no relation between tables.....it really looks like different Excel sheets!!!
I don't have problem to import the tables in a DatagridView of my Visual Studio project but in these tables the data are not easy to be understood for example:
there is a column named "Color" where the color are filled like number but there is not another Table who contain the color code. I know in my mind that color 1=Red, 2=Orange, 3=Brown etc.....
What I want to do?
I want that in my DataGridView won't be show the numbers but the color name so I need to modify my DataGrid source before display data.
How is did my project?
I have my DatagridView whose data source is a BindingSource that has a Dataset as DataSource. On my Load event I use the "Fill" method of my TableAdapter to display my tables data
Could someone suggest me how modify data before display them?
Thanks a lot
Giacomo

If all you are dealing with is a limited number of values in one or two fields, you could select the records using a query and obtain the color as follows:
SELECT Table1.ID, Table1.FldA, Table1.ClrFlag, IIf([clrflag]=1,"RED",IIf([clrflag]=2,"Orange",IIf([clrflag]=3,"Brown","Unknown")))
AS MyClr
FROM Table1
If there are many lookup's to do, I would create my own database with tables of code translations and join the two databases to produce my result. The following is an example of SQL pulling from two databases:
https://support.microsoft.com/en-us/help/113701/how-to-access-multiple-databases-in-an-sql-query-in-vb-3-0

Related

Can a single visual contain fields from 2 separate datasets in Quicksight?

The example above is where I'd like to have X axis coming from dataset_1, and Value coming from dataset_2.
In PowerBI and QlikSense, this is possible because 2 tables can be related via key fields without being joined.
But it seems in Quicksight, the visual is linked to a single dataset. When I change to a different dataset, the selection automatically goes out of the visual.
Am I missing some steps or is it just not possible in Quicksight?
In QuickSight, all visuals can only make use of a single dataset. However, if you have an author/admin account, you should be able to create a new dataset joining data coming from existing datasets see Creating dataset using existing datasets.
Alternatively you can create a new dataset and join the data coming from your datasource. See Joining Data

SSAS Tabular table always shows in Excel

In my SSAS tabular model I have a calendar dimension, and a wave dimension for half-year data only. The data flows to these tables as such:
Fact Table ---> Wave Dim <---> Calendar
No matter what I do I cannot hide the wave table from Excel users. The table shows hidden in Visual Studio, but in Excel it shows the table with no fields in it. I have tried deleting the table and reloading it with no avail. My assumption is that it has to do with the way it's connected to the Calendar dimension, but I can't seem to find anything on my issue. Any help would be much appreciated.
This is a tough one to answer without viewing your model.bim file. Based on your information I have two guesses on what could be the issue, although this may very well not be it:
1) It sounds like you've marked all fields in the Wave table as hidden, but not the Wave table itself. Could this be the reason?
2) Perhaps you are using perspectives, and only hid the Wave table in a perspective rather than in the Model (default perspective)?
The relationships in your model should have no impact on whether a table is displayed in client tools or not.
Feel free to upload your model.bim file if the above does not help.

MS Access loading values from a different table to control source in datasheet form

please bear with me; I'm not particularly confident with MS Access, although I am quite experienced with SQL Databases from website work.
For my sins, I have been tasked with developing a database which will unify the hundreds of spreadsheets which we currently use to record details of our clients, work, and other stuff... The database is established and built, but I am now working with the forms to allow data entry.
I have a datasheet form (we have a member of admin staff who is hell-bent on refusing to use forms, so a datasheet form seems to be the best way to appease her!) and it is bound to a specific table ('referrals') to allow a user to input data into that table. It looks like this:
However, I need to be able to load values from another table ('pupil_details') into the 'UPN' field so that if a pupil already exists in the 'pupil_details' table, the user can pick that pupil and have their details automatically filled into the form for convenience.
The form's Record Source is currently:
SELECT referrals.*
FROM referrals;
The most obvious way to do this seemed at first to be to use a join query for the form's record source, along the lines of:
SELECT referrals.*, pupil_details.UPN
FROM referrals LEFT JOIN pupil_details ON referrals.UPN = pupil_details.pupil_id
and then use this as the control source but when I do this, it breaks the functionality of the form (displays all the records, prevents it being used to enter data)
So, can anybody suggest to me how I might be able to get the 'UPN' field to display a list of records based on this query when a user types into it:
SELECT pupil_details.UPN, pupil_details.name, pupil_details.date_of_birth FROM pupil_details
But then enter the details into the 'referrals' table when the user submits the form? Sort of like this that I mocked up in Photoshop:
I'm stumped, and half a day on Google has left me none the wiser... :(
Thanks!
You should use a continuous form, not a datasheet, it will give you a lot more control, but still look like Excel. Once you have the form, you can add a combobox to get the details you want. It is nearly always best to avoid Excel attitudes in Access.

How to add a dropdown to datasheet form in MS Access which is based off a SQL Server query

I have a form in MS Access (datasheet view) which is based on the output of a SQL Server query. Now this is used in a front end where the user needs to be able to select from a drop down the value for one of the columns, 'NAME'. I tried adding a combo box which is mapped to take distinct names from the SQL Server table to the datasheet form but the results were not as desired.
Kindly provide advice on how this can be possible. I did this before by using a lookup on a similar MS Access database, but in a multi-user environment, the database was corrupted and now I moved my back end to SQL Server.
Just got the answer to my question. here are the steps I followed.
a) Add a combo box to the datasheet form in design view like Johnny Bones suggested.
b) Create a drop down with values.
c) Point the Control Source property to the field in the SQL Server table which needs to be updated, in this case NAME.
d) And voila, your drop-down now shows the values in the table and you can include a drop down for the user.
Thank you for pointing me in the right direction Johnny.
In datasheet view, I think you'll need to set up the field in the table.
Open the table in Design View
Click on the specific field in question
At the bottom you will see 2 tabs; General and Lookup (I
apologize, my work doesn't allow me to upload pics, so I hope you
can visualize it)
On the Lookup tab, change the Display Control from Text Box to
Combo Box
At that point, the properties should look familiar if you've worked with Combo Boxes, and you can change them to suit your needs.

Combining multiple datasets in PowerPivot

Essentially what I want to do is to create an interactive dashboard using slicers in Excel 2010 PowerPivot.
I have 3 different data sets from a sql database which share "dimensions."
Incoming Orders
Sales Order Backlog - essentially what products are currently in production and waiting
to ship or invoice
Invoiced Sales
Each data set shares certain "dimensions" such as Customer, Product, Time Period, Category, etc.
I want to have a specific chart for each of the business processes and have the slicers filter each chart at the same time. When someone chooses ACME Rockets as a customer, I want all three charts to update and show only information about ACME Rockets.
I could probably accompish this wiht a union statement and then hard filter each chart only to show it's subsection of the data, but I was hoping for something more intuitive.
Can anyone point me toward how I would accomplish this with PowerPivot?
You can create four charts at once and delete one and they will all be connected to the same slicers by default. Or, if you have already created three separate charts and have one slicer you want to connect them all to:
Select the chart not connected to the slicer.
On the PowerPivot ribbon, click the PowerPivot Window button.
Click the "Analyze" tab
Click on "Insert Slicer"
click on "Slicer Connections".
Put a check in the box next to the slicer(s) you want to connect your chart to.
Repeat for each chart.
It the tables are related to the fact tables in the underlying model then it should be really easy to have shared slicers. What you have to do is "connect" the slicers representing shared dimensions to all pivottables/charts that you are interested in.
Example:
1. insert pivot chart on sheet1
2. add a shared dimension attribute to the slicers pane
3. insert another pivotchart to the same sheet (sheet1)
4. add any measure from another fact that you are interested in slycing to the values pane for that chart
5. select the slicer representing the shared dim attribute
6. click on the "Options" tab and then on "PivotTable Connections" or right-click on the slicer and click "PivotTable Connections"
7. put a checkbox on all pivottables that you want for this slicer to "slice" :) - in this example it would be "PivotTable1 - Data for Sheet1 Chart1" or something like that
Additionally check a great powerpivot resource by Rob Collie (#powerpivotpro) at http://powerpivotpro.com for examples of using a main sheet with all slicers connected to all other pivots on other sheets.
Best regards,
#HrvojePiasevoli
Are you using PowerPivot 2010 or PowerPivot 2012? What kind of data source is it?
I would write a union when importing my data sets. I see you merging the three data sets into one fact table with a 'status' category containing 'incoming', 'backlog', 'invoiced'. You need a field to filter on, i.e. status. This will be based on the dataset the record is sourced from.
Do you want all the charts on the same sheet? In that case, choose the 'four charts' option, and delete one of the charts. If you add a slicer, it will automatically apply to all the charts on the sheet. Filter each chart by a 'status' type as described above. Create a slicer for 'customer'. That should give you what you described above.
Shout if this didn't answer your question.
In addition to what's already been said, if you are using PowerPivot 2012, be sure to do the following:
1) Use the new diagram view to verify that all of the appropriate relationships were detected and created on data import
2) Add or update any valid relationships between the tables in PowerPivot
Note: you may have to 'fix' your source data so that the joined results conform to business requirements. You can just write a T-SQL query check to verify prior to import, or you could use SSIS with Data Profiling Task and then view the output of the profile in the Data Profile Viewer tools (listed under SSIS) in the start menu.

Resources