Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Joined
Sep 6, 2007
Messages
418
Location
BE
Hey,

I don't see it right now.

I have a table with values. A user should make a selection of a row and column in a combobox (a different list). The value he retrieve should be used to make a calculation in my form.
Eg. I take Column C4 on row2 and get the value 400. How to ?

Code:
ID     C1  C2  C3  C4  C5
row1   100 200 300 456 456
row2   100 200 300 400 456
 
If your table has a primary key, which it should, then use the Dlookup function.
 
Or, you normalize your data like:
Code:
SELECT ID, "C1" as Col, [C1] as TheValue
FROM tblNoName
UNION ALL
SELECT ID, "C2", [C2]
FROM tblNoName
UNION
SELECT ID, "C3", [C3]
FROM tblNoName
UNION
SELECT ID, "C4", [C4]
FROM tblNoName
UNION
SELECT ID, "C5", [C5]
FROM tblNoName;
Then you can Select a value from [Col] from one combo box to use to filter your second combo box.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top