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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving new data through drop down list

Status
Not open for further replies.

TBL3

Programmer
Jun 6, 2011
50
CA
Hi,

I have lots of amount of raw data for each category.
And I was trying to see if there was any coding available for me to sort my data easier.

So, for example, for the following categories: building A, building B, & building C, it contains lots of raw data.

Hence, within building A,

x = 7
y = 10
c = 12

and for building B,

x = 8
y = 9
c = 15

and building C,

x = 12
y = 20
c = 5

Therefore, I was wondering how I should approach this by just having a drop down list for me to select one of the categories, and then the raw data would automatically populate according to the category selected.

FYI, there are more than those 3 variable raw data within the categories.

Any suggestions would be helpful.

Thanks,

 
What I would do is have 2 tables and name the text boxes the same as your data names
buldings
Buldingid BuldingName
1 building A
2 building B
3 building C

BilddingValues
BilddingValueid Buldingid Data Value
1 1 x 7
2 1 y 12
3 1 c 10
4 1 ? 99
5 2 x 8
.......

and on the after update of the combo

dim mydb as database
dim rst as recordset
Set mydb= currentdb
set rst = mydb.openrecorset("Select * from BilddingValues where Buldingid =" & me.Buldingcombo)

do while not rst.eof
me.(rst!data)=rst!value
loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top