What I am building is a notes configurator for our company this is the form shown below (all things in red are the parameters) Basically my user fills out the Prod Contact/Non-Prod Contact etc.. then select a number to the right that places it in a numbered order on the drawing. 1 = Note #1, 2 = Note #2, 0= Turns off that note.

So I got the rule to work if I write it out in what I consider long form but I was looking for a way to make it much more compact. This is the two sections of code I have for PC and NPC shown below. This works but is very long expecially since I have 20 fields. PC=field #1, NPC= field #2, etc....
So I noticed a pattern see below if the NUM1="1" then N1 =PC well if its going to be "N" and the matching NUM# then why just not say "N"+NUM#= N# hence the question. I started with.
'PREDEFINED NOTES
'[
PC = "ALL PRODUCT CONTACT MATERIAL WILL BE " & NOTES_PC & "."
NPC = "ALL NON-PRODUCT CONTACT MATERIAL WILL BE " & NOTES_NON_PC & "."
PCF = "ALL PRODUCT CONTACT MATERIAL WILL HAVE A " & NOTES_PC_FINISH & " MAX FINISH."
NPCF = "ALL NON-PRODUCT CONTACT MATERIAL WILL HAVE A " & NOTES_NONPC_FINISH & " MAX FINISH."
STW = "SANITARY TUBING WELDS - " & STW_ID & " ID AND " & STW_OD & " OD, " & STW_LOC & "."
']
'Puts #1 Line in any of the 20 fields
'[
If NUM1 = "1" Then
N1 = PC
ElseIf NUM1= "2" Then
N2 = PC
ElseIf NUM1= "3" Then
N3 = PC
ElseIf NUM1= "4" Then
N4 = PC
ElseIf NUM1= "5" Then
N5 = PC
ElseIf NUM1= "6" Then
N6 = PC
ElseIf NUM1= "7" Then
N7 = PC
ElseIf NUM1= "8" Then
N8 = PC
ElseIf NUM1= "9" Then
N9 = PC
ElseIf NUM1= "10" Then
N10 = PC
ElseIf NUM1= "11" Then
N11 = PC
ElseIf NUM1= "12" Then
N12 = PC
ElseIf NUM1= "13" Then
N13 = PC
ElseIf NUM1= "14" Then
N14 = PC
ElseIf NUM1= "15" Then
N15 = PC
ElseIf NUM1= "16" Then
N16 = PC
ElseIf NUM1= "17" Then
N17 = PC
ElseIf NUM1= "18" Then
N18 = PC
ElseIf NUM1= "19" Then
N19 = PC
ElseIf NUM1= "20" Then
N20 = PC
End If
']
'Puts #2 Line in any of the 20 fields
'[
If NUM2 = "1" Then
N1 = NPC
ElseIf NUM2= "2" Then
N2 = NPC
ElseIf NUM2= "3" Then
N3 = NPC
ElseIf NUM2= "4" Then
N4 = NPC
ElseIf NUM2= "5" Then
N5 = NPC
ElseIf NUM2= "6" Then
N6 = NPC
ElseIf NUM2= "7" Then
N7 = NPC
ElseIf NUM2= "8" Then
N8 = NPC
ElseIf NUM2= "9" Then
N9 = NPC
ElseIf NUM2= "10" Then
N10 = NPC
ElseIf NUM2= "11" Then
N11 = NPC
ElseIf NUM2= "12" Then
N12 = NPC
ElseIf NUM2= "13" Then
N13 = NPC
ElseIf NUM2= "14" Then
N14 = NPC
ElseIf NUM2= "15" Then
N15 = NPC
ElseIf NUM2= "16" Then
N16 = NPC
ElseIf NUM2= "17" Then
N17 = NPC
ElseIf NUM2= "18" Then
N18 = NPC
ElseIf NUM2= "19" Then
N19 = NPC
ElseIf NUM2= "20" Then
N20 = NPC
End If
']
Now I plugged in the expanded version of the answer I recieved see below
Dim PC As String
Dim NPC As String
Dim PCF As String
Dim NPCF As String
Dim STW As String
PC = "ALL PRODUCT CONTACT MATERIAL WILL BE " & NOTES_PC & "."
NPC = "ALL NON-PRODUCT CONTACT MATERIAL WILL BE " & NOTES_NON_PC & "."
PCF = "ALL PRODUCT CONTACT MATERIAL WILL HAVE A " & NOTES_PC_FINISH & " MAX FINISH."
NPCF = "ALL NON-PRODUCT CONTACT MATERIAL WILL HAVE A " & NOTES_NONPC_FINISH & " MAX FINISH."
STW = "SANITARY TUBING WELDS - " & STW_ID & " ID AND " & STW_OD & " OD, " & STW_LOC & "."
Parameter.Param("N"+NUM1).Value=PC
Parameter.Param("N"+NUM2).Value=NPC
Parameter.Param("N"+NUM3).Value=PCF
Parameter.Param("N"+NUM4).Value=NPCF
Parameter.Param("N"+NUM5).Value=STWBut It doesnt seem to be working correctly it seems to be randomly turning the notes on and off when I chose the placement number.
I do have something that works but I thought I might be able to simplify it. If so great, if not thats ok too.
Thanks,