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

Handling multiple user inputs on multiple popup forms?

Status
Not open for further replies.

Vie

Technical User
Jan 22, 2004
115
0
0
US
I'm hoping someone has some suggestions for this latest problem of mine. One the things the database I'm developing will do is to keep track of tenants living in various apartment buildings. The tenants can move from one apartment to another in the same building or to another building included in the database (over one hundred buildings). Additionally, they can just move out altogether or, as occasionally happens, they pass away. Both of these cases amounts to the same thing, namely, vacating the apartment which, in turn, allows for a new tenant to move in. A "new" tenant can be from within the system, within the same building, or be entirely new.

The events that happen most often are someone moving out entirely and a new tenant moving in, and tenants moving to different apartments in the same buiding. In the second case, it can be a matter of two tenants switching apartments or, the more nightmarish (for me) possibility of any number of tenants moving around in the same building in a chain-like scenario reminiscient of musical chairs.

I am starting with scenario of tenants moving around in the same building. For this, I cannot predict in advance how many tenants will be involved so I need to loop through, say, a popup form (the same one) as many times as needed. I'm working on:

Tenant1 of ApartmentA moves to ApartmentB

which is occupied by

Tenant2 who, in turn, moves to ApartmentC

which is occupied by

Tenant3 who, in turn, moves to ApartmentD

which is occupied by

Tenant4 who moves out altogether.

Note, that it is ApartmentA that ends up vacant, though it is Tenant4 who moves out completely.

I'm figuring the popup form will have two comboboxes on it, one for tenants and the other for apartments. I'll select the first tenant to move and then select the apartment they are moving to. If there's a tenant already in that apartment, a message box appears and asks if the current tenant is moving out or moving to another apartment, etc.

What actually happens behind the scenes is that the TenantID in the table that relates a given tenant to his/her apartment, tblTenantsApartments ([TenantID], [ApartmentID]), gets erased and the others get assigned to the new apartments. In the table, both TenantID and ApartmentID are foreign keys and there is only one record for each apartment and each tenant (naturally) only appears once. To change the tenantID for a given apt, I'm using ADO to access the table. I can do simple things like null out a TenantID or change it to another TenantID for a given apartment but I'm not sure how to handle the whole chain mess.

I'm looking into using a dynamic multi-dimensional array with two columns and N number of rows. But the truth is, I don't really know how to tackle getting the data from the comboboxes from multiple successive popups into the array.

Apologies for the long-windedness of my post.

Anyone have any suggestions?

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top