Midavalo
New member
Hi,
This is my first question here, hopefully I've put it in the correct place.
I'm trying to build a small app (for fun, at home) that looks up values based on two input values. I had thought I'd create a simple MS Access table and look up from that, but I just can't figure out how to connect to the Access table and return any values. I'm using Visual Studio 2013 and Access 2013.
Firstly, is an Access table the best place to store and lookup these values? I have previously pulled values from a my.settings file (in a different project), but there are no lookups so that was fairly easy to setup.
Secondly how do I perform the lookup and get the value returned?
There are 57 rows and 7 columns. First value I want to query is from the first column, second value determines which of the remaining 6 columns to select from (in the form of selection from 1-6), so using the table below, if I input 20000 in the first textbox and 4 in the second textbox it would return a value of 103.
Alternatively I could pivot it slightly, so would lookup 20000 from first column and 4 from second column would return 103 from third column.
Please let me know if there is any other info I need to supply.
Cheers,
Mike.
This is my first question here, hopefully I've put it in the correct place.
I'm trying to build a small app (for fun, at home) that looks up values based on two input values. I had thought I'd create a simple MS Access table and look up from that, but I just can't figure out how to connect to the Access table and return any values. I'm using Visual Studio 2013 and Access 2013.
Firstly, is an Access table the best place to store and lookup these values? I have previously pulled values from a my.settings file (in a different project), but there are no lookups so that was fairly easy to setup.
Secondly how do I perform the lookup and get the value returned?
There are 57 rows and 7 columns. First value I want to query is from the first column, second value determines which of the remaining 6 columns to select from (in the form of selection from 1-6), so using the table below, if I input 20000 in the first textbox and 4 in the second textbox it would return a value of 103.
Amount | V1 | V2 | V3 | V4 | V5 | V6 |
10000 | 10 | 20 | 30 | 40 | 50 | 60 |
20000 | 100 | 101 | 102 | 103 | 104 | 105 |
30000 | 110 | 115 | 120 | 125 | 130 | 135 |
40000 | 200 | 400 | 600 | 800 | 1000 | 1200 |
Alternatively I could pivot it slightly, so would lookup 20000 from first column and 4 from second column would return 103 from third column.
Amount | Count | Value |
10000 | 1 | 10 |
10000 | 2 | 20 |
10000 | 3 | 30 |
10000 | 4 | 40 |
10000 | 5 | 50 |
10000 | 6 | 60 |
20000 | 1 | 100 |
20000 | 2 | 101 |
20000 | 3 | 102 |
20000 | 4 | 103 |
20000 | 5 | 104 |
20000 | 6 | 105 |
30000 | 1 | 110 |
30000 | 2 | 115 |
30000 | 3 | 120 |
30000 | 4 | 125 |
30000 | 5 | 130 |
30000 | 6 | 135 |
40000 | 1 | 200 |
40000 | 2 | 400 |
40000 | 3 | 600 |
40000 | 4 | 800 |
40000 | 5 | 1000 |
40000 | 6 | 1200 |
Please let me know if there is any other info I need to supply.
Cheers,
Mike.