Hi, appreciate if someone could help me with the following:
I've created a form with the folowing user form coding:
Dim myArray4() As String 'CCM
Dim myArray6() As String 'FRANCE
Dim myArray7() As String 'GERMANY
Dim myArray19() As String 'UNITED KINGDOM
Dim i As Long
myArray6 = Split("AN(Angers) CR(Crolles) FR(France) PR(Paris) TL(Toulouse)")
Me.PayScaleArea.Clear
Select Case ActiveDocument.FormFields("Country_Name").Result
Case "Switzerland"
Me.PayScaleArea.List = myArray4
Case "FRANCE"
Me.PayScaleArea.List = myArray6
Case "GERMANY"
Me.PayScaleArea.List = myArray7
Case "UK/IRELAND"
Me.PayScaleArea.List = myArray19
End Select
End Sub
-------------
I wish to get the same selection list with Germany (myArray7) when I select
another 2 country called "Switzerland" or "Denmark".
Can anyone guide me on how to put a OR statement in the above coding?
Greg Maxey - 12 Feb 2008 03:59 GMT
I am not sure if I understand your question.
You want the same thing in the list if the user selects GERMANY, DENMARK or
SWITZERLAND?
Private Sub UserForm_Initialize()
Dim myArray4() As String 'CCM
Dim myArray6() As String 'FRANCE
Dim myArray7() As String 'GERMANY
Dim myArray19() As String 'UNITED KINGDOM
Dim pStr As String
Dim i As Long
myArray6 = Split("AN(Angers) CR(Crolles) FR(France) PR(Paris) TL(Toulouse)")
myArray7 = Split("A B C D E F G")
pStr = "DENMARK"
Me.PayScaleArea.Clear
Select Case pStr 'ActiveDocument.FormFields("Country_Name").Result
Case "FRANCE"
Me.PayScaleArea.List = myArray6
Case "GERMANY", "SWITZERLAND", "DENMARK"
Me.PayScaleArea.List = myArray7
Case "UK/IRELAND"
Me.PayScaleArea.List = myArray19
End Select
End Sub

Signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Hi, appreciate if someone could help me with the following:
>
[quoted text clipped - 32 lines]
> select another 2 country called "Switzerland" or "Denmark".
> Can anyone guide me on how to put a OR statement in the above coding?
Jay Freedman - 12 Feb 2008 04:03 GMT
>Hi, appreciate if someone could help me with the following:
>
[quoted text clipped - 32 lines]
>another 2 country called "Switzerland" or "Denmark".
>Can anyone guide me on how to put a OR statement in the above coding?
Just add the expressions to the same Case line, separated by commas:
Case "GERMANY", "SWITZERLAND", "DENMARK"
Then any of those three values will cause the myArray7 value to be assigned.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.