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

Extract variable from list box on same form 1

Status
Not open for further replies.

DugyWugy

Technical User
Oct 13, 2000
25
CA
I wish to populate a list box based on the variable declared in the previous list box. Which will in turn provide the variable for the search to provide the data for the next list box.
I have tried using DLookup and haven't had any success.

ie. Owner - Apartment Buildings - Apartments.
I wish to select one owner from my owner table, the next list box will then be populated by the apartment buildings owned only by that owner (not all of the owners), and so on.

Any suggestions would be greatly appreciated.
Thankyou [sig][/sig]
 
Well its all in the recordsource
the second and third list boxes look at the first and second.
I have 3 list boxes
---------------- List box 0 Owner-------------------------
Private Sub List0_AfterUpdate()
List2.Requery
List4.Requery
End Sub

Row Source = SELECT DISTINCTROW [Owner].[Owner] FROM [Owner];

Bound column = 1

---------------- List box 2 AptBuilding ------------------

Private Sub List2_AfterUpdate()
List4.Requery
End Sub

Row Source = SELECT DISTINCTROW AprtBuild.Owner, AprtBuild.ApartmentBuilding FROM AprtBuild WHERE (((AprtBuild.Owner)=[Forms]![Form1]![List0]));

Bound column = 2


---------------- List box 4 Apartment----------------------
List 4 has no After update event

Row Source = SELECT DISTINCTROW Apartment.ApartmentBuilding, Apartment.Apartment FROM Apartment WHERE (((Apartment.ApartmentBuilding)=[Forms]![Form1]![List2]));

Bound column = 2

[sig]<p>DougP, MCP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top