Question : Select Case

Hi Experts,

I have a subform called Fo_supInvSubform with two combo fields 'Sup_ProdID' and 'Description'.

They have values in them. The idea is that when a value is selected in 'Sup_ProdID', the drop down list in 'Description' will filter out the relavent values. With this in mind, I wrote the following VBA and put it in The After Update and On Change events of Sup_ProdID.

I have inputted the following in the row source of the Description field:

"PP bag MW 127x50";"PP bag Clear 127x50"

And the row source type to be 'value list'

The problem I am having is that when I am selecting the value in the Sup_ProdID field, say PB1w, it is debuggin on the VBA and going to the word value in the second line of the Code (Form_Fo_supInvSubform.Description.value).

Please help. Thanks

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
Select Case Form_Fo_supInvSubform.Sup_ProdID.value &
Form_Fo_supInvSubform.Description.value
 
Case "PB1w" 
         StrList =  PP bag, MW, 127x50
 
Case "PB1Cl" 
         StrList =  PP bag Clear 127x50
 
 
End Select 
  
 Me.Description = StrList 
 Me.Description.Requery

Answer : Select Case

Oops, sorry.  I didn't remove the Description like I mentioned.  Here's what it should look like:

Dim strList As String

    Select Case Me.Sup_ProdID.Value
        Case "PB1w"
            strList = "PP bag, MW, 127x50"
        Case "PB1Cl"
            strList = "PP bag Clear 127x50"
    End Select
 
    Me.Description = strList
Random Solutions  
 
programming4us programming4us