Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Extract variable from list box on same form

Extract variable from list box on same form

Extract variable from list box on same form

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.

RE: Extract variable from list box on same form

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()
End Sub

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

Bound column = 1

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

Private Sub List2_AfterUpdate()
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

DougP, MCP

Ask me how Bar-codes can help you be more productive.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close