473,498 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TABLE LOOKUPS FROM PRICE MATRIX

Hi All.
I need some help trying to pull prices from a price matrix. Here's an
example:

1000 1500 2000 2500
-----------------------------------------
1000 ¦ 10.20 11.95 12.55 13.76

1500 ¦ 11.23 12.23 13.45 14.45

2000 ¦ 12.99 13.56 14.71 15.62
Let me explain. The header row is millimetres, and indeed relates to
the width of a window. The first column is also in millimetres, and
relates to the height of a window. The data are prices in GBP.

From this table, I can work out the price of a window depending on
it's size. For example, a window of 1000w x 1500h is £11.23. A
window of 1100w x 1500h would be £12.23.(This is because the width of
the window breaks the 1000mm price band, and goes into the 1500mm
price band.)

Okay, so far so good. Now then... up until now, in order to get
access 2k to pull this information out of a table format, I have had
to create a table with three fields in a standard access list table
format. The field names are: WIDTH, HEIGHT, PRICE.

I extract the table using a SELECT SQL statement, and it works fine.
(ie - SELECT PRICE from PriceTable WHERE WIDTH >=myWidth AND HEIGHT=myHeight etc). My problem is that I need to allow the user to

create a new price table, and enter the data into an excel style grid
(as shown above), but I just can't work out how I'm supposed reference
the data, or indeed store the data from this format.

If I want to view my standard access table in matrix format, I simply
use a crosstab query to do so. The problem with crosstabs are that
they are not editable, and that still wouldn't answer my question on
how I'm supposed to allow the user to enter the data in the first
place.

I'm aware of the INDEX/MATCH functions from excel, but it's long
winded, and of course relies on calling Excel Dll's.

I've thought about the possiblility of creating a table with say 10
fields, named HEIGHT, WIDTH_1, WIDTH_2 etc etc.... And having the
first row as my width breakpoints, but I can't see how I would
reference that from SQL statements.

Can somebody please help me??

Thanks
Nov 12 '05 #1
3 4763
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just have a form that has the columns (fields) set up the same as the
table's. Why can't a user understand that? It is just as easy to
understand as a matrix (which may expand off the visible part of the
display screen). Just be sure the Height & Width columns are marked as
Primary Keys so no duplicates can be entered.

You could have the above set up & a button on the form that shows the
user the cross-tab results (matrix) of the data they just entered, if
they wanted to see it that way.

If you insist on having a matrix input form:

The form will have to be unbound.
When the user is finished - click a save button.
The save routine will go thru each cell & insert/update the table
records, 1 record/cell at a time. Lots of VBA coding.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQIhKeYechKqOuFEgEQI7cACffz+jy47tkIj5Y8QtYpskFg YxVQUAoJ3f
gpxr6C0wWMN6aymyV7rWNwkQ
=efx+
-----END PGP SIGNATURE-----
Gigi.com wrote:
Hi All.
I need some help trying to pull prices from a price matrix. Here's an
example:
> 1000 1500 2000 2500


-----------------------------------------
1000 ¦ 10.20 11.95 12.55 13.76

1500 ¦ 11.23 12.23 13.45 14.45

2000 ¦ 12.99 13.56 14.71 15.62
Let me explain. The header row is millimetres, and indeed relates to
the width of a window. The first column is also in millimetres, and
relates to the height of a window. The data are prices in GBP.

From this table, I can work out the price of a window depending on
it's size. For example, a window of 1000w x 1500h is £11.23. A
window of 1100w x 1500h would be £12.23.(This is because the width of
the window breaks the 1000mm price band, and goes into the 1500mm
price band.)

Okay, so far so good. Now then... up until now, in order to get
access 2k to pull this information out of a table format, I have had
to create a table with three fields in a standard access list table
format. The field names are: WIDTH, HEIGHT, PRICE.

I extract the table using a SELECT SQL statement, and it works fine.
(ie - SELECT PRICE from PriceTable WHERE WIDTH >=myWidth AND HEIGHT
=myHeight etc). My problem is that I need to allow the user to


create a new price table, and enter the data into an excel style grid
(as shown above), but I just can't work out how I'm supposed reference
the data, or indeed store the data from this format.

If I want to view my standard access table in matrix format, I simply
use a crosstab query to do so. The problem with crosstabs are that
they are not editable, and that still wouldn't answer my question on
how I'm supposed to allow the user to enter the data in the first
place.

I'm aware of the INDEX/MATCH functions from excel, but it's long
winded, and of course relies on calling Excel Dll's.

I've thought about the possiblility of creating a table with say 10
fields, named HEIGHT, WIDTH_1, WIDTH_2 etc etc.... And having the
first row as my width breakpoints, but I can't see how I would
reference that from SQL statements.


Nov 12 '05 #2
MGFoster <me@privacy.com> wrote in message news:<OT****************@newsread2.news.pas.earthl ink.net>...
Thanks for the concept. That idea would work fine. Unfortunately,
the data must be entered like this becuase it's very much an industry
standard way of view price tables. It also makes it very easy to copy
data from a price table.
If you can help me with any code it would be appreciated.

Cheers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just have a form that has the columns (fields) set up the same as the
table's. Why can't a user understand that? It is just as easy to
understand as a matrix (which may expand off the visible part of the
display screen). Just be sure the Height & Width columns are marked as
Primary Keys so no duplicates can be entered.

You could have the above set up & a button on the form that shows the
user the cross-tab results (matrix) of the data they just entered, if
they wanted to see it that way.

If you insist on having a matrix input form:

The form will have to be unbound.
When the user is finished - click a save button.
The save routine will go thru each cell & insert/update the table
records, 1 record/cell at a time. Lots of VBA coding.

Nov 12 '05 #3
gi*******@yahoo.co.uk (Gigi.com) wrote in message news:<f5**************************@posting.google. com>...
MGFoster <me@privacy.com> wrote in message news:<OT****************@newsread2.news.pas.earthl ink.net>...
Thanks for the concept. That idea would work fine. Unfortunately,
the data must be entered like this becuase it's very much an industry
standard way of view price tables. It also makes it very easy to copy
data from a price table.
If you can help me with any code it would be appreciated.

Cheers


This is a very interesting problem. It's much tougher than it looks
to make Access do too much Excel stuff. Some other threads in this NG
talk about using Excel within Access. Since Excel was likely used by
the people who created the industry standard it seems a
non-Access-only solution might be in order. I've had success with
Excel automation from Access but have never tried to embed an Excel
object within Access. Of course having Access emulate Excel
capabilities, though a bit of a kludge, is much better than trying to
use Excel as a database :-). If your Height and Width values vary for
different kinds of windows or your price matrix is over about 15 X 15
then I think you're trying to push Access to do something that is done
better by Excel. Finding prices from the spreadsheet is similar to
what you use currently in SQL except you are traversing the first row
and column instead of Width and Height values in an Access table. It
would be really nice if Access actually had native two and three
dimensional tables that could easily map to arrays. A 3D interface to
change the values would also be nice. Just click up or down to see
the next 2D layer. Er.., click right or left to see the next 2D
layer. Er.., click shallower or deeper to see the next 2D layer.

James A. Fortune

Being poor is best left to those who have no money.
- Taxi
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6563
by: John Mudd | last post by:
I must be missing something here. It's clearly faster to lookup an item directly in a dictionary than to scan through a list. So when I have a large lookup table I always load it in the form of a...
0
3047
by: B. Fongo | last post by:
I learned MySQL last year without putting it into action; that is why I face trouble in formulating my queries. Were it a test, then you would have passed it, because your queries did help me...
1
3412
by: Stephen Patten | last post by:
Hi All, While in the process of building my table (40 or so Insert statments) can I then query ("select * from @Table_variable") and use the results up to theat point for another insert into...
3
342
by: Gigi.com | last post by:
Hi All. I need some help trying to pull prices from a price matrix. Here's an example: >>>> 1000 1500 2000 2500 ----------------------------------------- 1000 ¦ 10.20 ...
4
2045
by: Paul | last post by:
Hi, When should I use a list (in table properties: like Ford;Mercedes;BMW;Audi ) and when should I use a lookup table?? And second question: IF I use a lookup table, should I always make a...
2
2893
by: King Ron | last post by:
Ola all. In responding to a recent post requesting help with a search issue, I recommended using a combo box lookup in the table design. "paii, Ron" (no relation) posted this reply: " There are...
3
4397
by: binita2908 | last post by:
Hi guys , I am quite a baby to sql , pls help me out in this . My database scheme consists of four relations: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price)...
3
1585
by: robert | last post by:
Often I want to extract some web table contents. Formats are mostly static, simple text & numbers in it, other tags to be stripped off. So a simple & fast approach would be ok. What of the...
23
5695
by: raylopez99 | last post by:
A quick sanity check, and I think I am correct, but just to make sure: if you have a bunch of objects that are very much like one another you can uniquely track them simply by using an ArrayList...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.