Selecting Parts of a particular type (1 Viewer)

casey

Registered User.
Local time
Today, 15:00
Joined
Dec 5, 2000
Messages
448
Hello all,

I have a simple table [tblService] consisting of [Type] and [Part].
i.e.

Type: Part:
------- -----------
CPU Intel 650
MOD Conexant 56.6
VIRU Norten 2002
and so on...

I have a form [frmParts] in which the user selects the [Type] and then selects the [Part] (like above). The fields are comboboxes based on a query that selects the distinct([Type]) for the user to either select one or enter a new [Type] if needed.

Once a [Type] is selected, is there a way to filter the [Part] field by that particular [Type] preceding it? So if a user selects [Type]:CPU, when he/she clicks on the [Part] combo, only parts that are CPU's will be displayed.

I've tried....
SELECT DISTINCT([tblService].[Part]) AS Expr1
FROM tblService
WHERE (((tblService.Type)=[Forms]![frmParts].[Type]))
ORDER BY tblService.Part;

But this doesn't return the proper [Type] directly preceding it.

Any ideas?
 

casey

Registered User.
Local time
Today, 15:00
Joined
Dec 5, 2000
Messages
448
I figured it out!!!!!!!

Five seconds after I submitted this post.....

I figured out that the query works, but I need requery the the [Parts] combo after the [Type] has LostFocus().

Thanks to anyone who may have responded!
 

DBL

Registered User.
Local time
Today, 15:00
Joined
Feb 20, 2002
Messages
659
Put the requery on the AfterUpdate event of the Type combo. I sometimes put it on the OnEntry of the second combo just to be sure!
 

Users who are viewing this thread

Top Bottom