Question : Syntax for case select

Dear Experts. I have fields A and B in a form. Both are Combo Boxes. The field B Row source type  is value list and Rowsource has the follwoing items - "Y";"Z"

In the after update event of the field A, I have a case select VBA which does this for example:

If A is M, then B is Y.
If A is N, then B is Z

But I also need to have a provision for the following:

If A is X, then B is Y or Z and Y and Z show up in the combo box of field B

What is the syntax for this please for this?
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Dim strList As String
 
    Select Case Me.A.Value
        Case "M"
            strList = "Y"
  
        Case "N"
            strList = "Z"
 
      
    End Select
  
    Me.B = strList

Answer : Syntax for case select

Hi Patrick,

All I want is to know the syntax for multiple values. For example, in my code, the following is not working:

Case "M"
            strList = "Y;Z"

Neither is:

Case "M"
            strList = "'Y';'Z'"

Thanks :)
Random Solutions  
 
programming4us programming4us