linked combo-boxes in a subform

G

Gsm

Im wondering if anyone has any suggestions about a query i
have concerning linked combo boxes on a subform.

The first combo box will be used to select components.
For example Hard drives, RAM. If selecting hard drives
then the second combo box will show hard drive types such
as 20GBhdd, 40GBHDD or if selecting RAM in the first combo
box then RAM types will be 128Mb, 256Mb DDR.

The Subform is set up as a continous form so there will be
various components on view on the different records.

The problem is that when selecting the first combo box and
scrolling to Hard drive components (for example) then
information in the second combo boxes not related to that
specific component are cleared meaning you can only view
records stored in combo boxes linked to that component type


I was wondering if there is any code i can add to make
sure all combo boxes whether linked to that component type
or not remain visible to the user.


The code for the first combo box: cboStore

SELECT [tblStore].[IngStoreID], [tblStore].[strStoreName]
FROM tblStore;


The code for the second combo box: cboManager

SELECT [tblManager].[IngManagerID], [tblManager].
[IngStoreID], [tblManager].[strManagerName] FROM
tblManager WHERE [IngStoreID]=3;


Inserted into cbostore combo box is the following code:

Private Sub cboStore_AfterUpdate()
Dim sManagerSource As String

sManagerSource = "SELECT [tblManager].[IngManagerID],
[tblManager].[IngStoreID], [tblManager].[strManagerName] "
& _
"FROM tblManager " & _
"WHERE [IngStoreID] = " & Me.cboStore.Value
Me.cboManager.RowSource = sManagerSource
Me.cboManager.Requery
End Sub


Any help/suggestions would gratefully be received
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top