Fill a subform with values from diff tables dep on listbox

Fluffy

Registered User.
Local time
Today, 20:54
Joined
Sep 23, 2003
Messages
15
Hey,

I have 4 tables: Servers, PCs, Printers, XX.

I also have a form with 2 listboxes: one listbox to chose the table to perform the query on, another listbox to chose whether warrenty on the chosen equipment is expired yes or no.

For example: I want to see all the Printers that have an expired warrenty. Or I want to see all the XX that are still under warrenty.

How can I do this?

I would like the info to be in some kind of subform. The names of the fields in each table are like SEid, SEbrand, SEtype, SEwarrenty (is date), SEwarrentyUntill (also date); PCid, PCbrand, ...

Thanks
 
Create a form with your two listboxes and add a subform to it. Your listboxes don't sound like they depend on each other, so that's simple. (You could have it be more sophisticated and only present the propery warranty choices. For example, if you have no server off warranty, then why display the off-warranty choice in the 2nd listbox). Anyhow, investigate cascading combo boxes if you are interested. There's a nice FAQ written by Mile-O-Phile and/or read this article: Cascading Lists for Access Forms

The subform needs to be based on a query that will reference the two choices you've made in your main form. This article will help you a bit: Customizing Access Parameter Queries. You'll still need to worry about picking the right table. But why have the 4 datasets in 4 tables? Why not have it all in one table? Especially if the field structure is the same. Just add a field for equipment type.
 
dcx693 said:
But why have the 4 datasets in 4 tables? Why not have it all in one table? Especially if the field structure is the same. Just add a field for equipment type.

This isn't the only info in the tables. (for instance: a printer doesn't have a hard drive, but a pc does)

But it is the only info I want this query to show. That's why I have different tables.

I'll check those links you posted.

Thank you
 

Users who are viewing this thread

Back
Top Bottom