Skip to main content

Hi guys,

Is there a limit for rumba script on what on the if statements? below is my code and the error:

(basically, I want the if statements to come up with instruction to the user based on their input (Dlg1.num), then display the instruction in a msg box. Error occurred at the ElseIf -"Syntax error on line: 45 - ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_)

kbs = ""

If Dlg1.num = "06" Or Dlg1.num="0611" Or Dlg1.num="0613" Or Dlg1.num="0616" Or Dlg1.num="0625" _ Or Dlg1.num="0628" Or Dlg1.num="0631" Or Dlg1.num="0633" Or Dlg1.num="0645" Or Dlg1.num="0648" _ Or Dlg1.num="0650" Or Dlg1.num="0663" Or Dlg1.num="11" Or Dlg1.num="1106" Or Dlg1.num="1113" _ Or Dlg1.num="1116" Or Dlg1.num="1125" Or Dlg1.num="1128" Or Dlg1.num="1131" Or Dlg1.num="1133" _ Or Dlg1.num = "1145" Or Dlg1.num="1148" Or Dlg1.num="1150" Or Dlg1.num="1163" Or Dlg1.num="13" _

Then

kbs = kbs & "1. Eligibility" kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_ Or Dlg1.num="1331" Or Dlg1.num="1333" Or Dlg1.num="1345" Or Dlg1.num="1348" Or Dlg1.num="1350"_ Or Dlg1.num="1363" Or Dlg1.num="16" Or Dlg1.num="1606" Or Dlg1.num="1611" Or Dlg1.num="1613"_ Or Dlg1.num="1625" Or Dlg1.num="1628" Or Dlg1.num="1631" Or Dlg1.num="1633" Or Dlg1.num="1645"_

Then

kbs = kbs & "1. Eligibility; 2. Check other stuff." kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

Else kbs = "Invalid Input."

End IF

response = MsgBox ( kbs , MB_OKCANCEL , "PLUA Check Points" )

If response = IDCANCEL Then Exit Sub End If

Again, thx!


#Rumba

Hi guys,

Is there a limit for rumba script on what on the if statements? below is my code and the error:

(basically, I want the if statements to come up with instruction to the user based on their input (Dlg1.num), then display the instruction in a msg box. Error occurred at the ElseIf -"Syntax error on line: 45 - ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_)

kbs = ""

If Dlg1.num = "06" Or Dlg1.num="0611" Or Dlg1.num="0613" Or Dlg1.num="0616" Or Dlg1.num="0625" _ Or Dlg1.num="0628" Or Dlg1.num="0631" Or Dlg1.num="0633" Or Dlg1.num="0645" Or Dlg1.num="0648" _ Or Dlg1.num="0650" Or Dlg1.num="0663" Or Dlg1.num="11" Or Dlg1.num="1106" Or Dlg1.num="1113" _ Or Dlg1.num="1116" Or Dlg1.num="1125" Or Dlg1.num="1128" Or Dlg1.num="1131" Or Dlg1.num="1133" _ Or Dlg1.num = "1145" Or Dlg1.num="1148" Or Dlg1.num="1150" Or Dlg1.num="1163" Or Dlg1.num="13" _

Then

kbs = kbs & "1. Eligibility" kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_ Or Dlg1.num="1331" Or Dlg1.num="1333" Or Dlg1.num="1345" Or Dlg1.num="1348" Or Dlg1.num="1350"_ Or Dlg1.num="1363" Or Dlg1.num="16" Or Dlg1.num="1606" Or Dlg1.num="1611" Or Dlg1.num="1613"_ Or Dlg1.num="1625" Or Dlg1.num="1628" Or Dlg1.num="1631" Or Dlg1.num="1633" Or Dlg1.num="1645"_

Then

kbs = kbs & "1. Eligibility; 2. Check other stuff." kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

Else kbs = "Invalid Input."

End IF

response = MsgBox ( kbs , MB_OKCANCEL , "PLUA Check Points" )

If response = IDCANCEL Then Exit Sub End If

Again, thx!


#Rumba

Hi,

there is no limit but your syntax seems to be incorrect.

The If...Thenblock has a single line and multiple line syntax. The condition of an If statement can be a comparison or an expression, but
it must evaluate to True or False.

If condition ThenStatements... 'single line syntax
If condition Then
'multiple line syntax
statements...
End If

The other variation on the If statement is the If...Then...Else statement.This statement should be used when there is different
statement blocks to be executed depending on the condition. There is also the If...Then...ElseIf... variation, these can get quite long and
cumbersome, at which time you should consider using the Select statement.

If condition Then
statements...
ElseIf condition Then
statements...
Else
End If


The Select Case statement tests the same variable for many different values. This statement tends to be easier to read, understand and
follow and should be used in place of a complicated If...Then...ElseIf statement.

Select Case variable to test
Case1
statements...
Case2
statements...
Case3
statements...
Case Else
statements...
End Select

hope it helps

AE


Hi guys,

Is there a limit for rumba script on what on the if statements? below is my code and the error:

(basically, I want the if statements to come up with instruction to the user based on their input (Dlg1.num), then display the instruction in a msg box. Error occurred at the ElseIf -"Syntax error on line: 45 - ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_)

kbs = ""

If Dlg1.num = "06" Or Dlg1.num="0611" Or Dlg1.num="0613" Or Dlg1.num="0616" Or Dlg1.num="0625" _ Or Dlg1.num="0628" Or Dlg1.num="0631" Or Dlg1.num="0633" Or Dlg1.num="0645" Or Dlg1.num="0648" _ Or Dlg1.num="0650" Or Dlg1.num="0663" Or Dlg1.num="11" Or Dlg1.num="1106" Or Dlg1.num="1113" _ Or Dlg1.num="1116" Or Dlg1.num="1125" Or Dlg1.num="1128" Or Dlg1.num="1131" Or Dlg1.num="1133" _ Or Dlg1.num = "1145" Or Dlg1.num="1148" Or Dlg1.num="1150" Or Dlg1.num="1163" Or Dlg1.num="13" _

Then

kbs = kbs & "1. Eligibility" kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_ Or Dlg1.num="1331" Or Dlg1.num="1333" Or Dlg1.num="1345" Or Dlg1.num="1348" Or Dlg1.num="1350"_ Or Dlg1.num="1363" Or Dlg1.num="16" Or Dlg1.num="1606" Or Dlg1.num="1611" Or Dlg1.num="1613"_ Or Dlg1.num="1625" Or Dlg1.num="1628" Or Dlg1.num="1631" Or Dlg1.num="1633" Or Dlg1.num="1645"_

Then

kbs = kbs & "1. Eligibility; 2. Check other stuff." kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

Else kbs = "Invalid Input."

End IF

response = MsgBox ( kbs , MB_OKCANCEL , "PLUA Check Points" )

If response = IDCANCEL Then Exit Sub End If

Again, thx!


#Rumba

Thanks AE. My problem lies in the condition part. As you can see I have many "Or" in each condition, these are all values that lead to the same msg box. The error msg is referring to the condition part. I guess the question should be "Is there limitation on the condition?" Aslo I can have multiple ElseIf...Then, right? Thanks, again.


Hi guys,

Is there a limit for rumba script on what on the if statements? below is my code and the error:

(basically, I want the if statements to come up with instruction to the user based on their input (Dlg1.num), then display the instruction in a msg box. Error occurred at the ElseIf -"Syntax error on line: 45 - ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_)

kbs = ""

If Dlg1.num = "06" Or Dlg1.num="0611" Or Dlg1.num="0613" Or Dlg1.num="0616" Or Dlg1.num="0625" _ Or Dlg1.num="0628" Or Dlg1.num="0631" Or Dlg1.num="0633" Or Dlg1.num="0645" Or Dlg1.num="0648" _ Or Dlg1.num="0650" Or Dlg1.num="0663" Or Dlg1.num="11" Or Dlg1.num="1106" Or Dlg1.num="1113" _ Or Dlg1.num="1116" Or Dlg1.num="1125" Or Dlg1.num="1128" Or Dlg1.num="1131" Or Dlg1.num="1133" _ Or Dlg1.num = "1145" Or Dlg1.num="1148" Or Dlg1.num="1150" Or Dlg1.num="1163" Or Dlg1.num="13" _

Then

kbs = kbs & "1. Eligibility" kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_ Or Dlg1.num="1331" Or Dlg1.num="1333" Or Dlg1.num="1345" Or Dlg1.num="1348" Or Dlg1.num="1350"_ Or Dlg1.num="1363" Or Dlg1.num="16" Or Dlg1.num="1606" Or Dlg1.num="1611" Or Dlg1.num="1613"_ Or Dlg1.num="1625" Or Dlg1.num="1628" Or Dlg1.num="1631" Or Dlg1.num="1633" Or Dlg1.num="1645"_

Then

kbs = kbs & "1. Eligibility; 2. Check other stuff." kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

Else kbs = "Invalid Input."

End IF

response = MsgBox ( kbs , MB_OKCANCEL , "PLUA Check Points" )

If response = IDCANCEL Then Exit Sub End If

Again, thx!


#Rumba

No there is no limit on the condition part.
The Then statement needs to be in the same line. (single line command)

I attached a screen shot to demonstrate the correct line breaks and Line Continuation Character:
The underscore is the line continuation character in Rumba Script. There must be a space before and after the line continuation character.

regards

AE


Hi guys,

Is there a limit for rumba script on what on the if statements? below is my code and the error:

(basically, I want the if statements to come up with instruction to the user based on their input (Dlg1.num), then display the instruction in a msg box. Error occurred at the ElseIf -"Syntax error on line: 45 - ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_)

kbs = ""

If Dlg1.num = "06" Or Dlg1.num="0611" Or Dlg1.num="0613" Or Dlg1.num="0616" Or Dlg1.num="0625" _ Or Dlg1.num="0628" Or Dlg1.num="0631" Or Dlg1.num="0633" Or Dlg1.num="0645" Or Dlg1.num="0648" _ Or Dlg1.num="0650" Or Dlg1.num="0663" Or Dlg1.num="11" Or Dlg1.num="1106" Or Dlg1.num="1113" _ Or Dlg1.num="1116" Or Dlg1.num="1125" Or Dlg1.num="1128" Or Dlg1.num="1131" Or Dlg1.num="1133" _ Or Dlg1.num = "1145" Or Dlg1.num="1148" Or Dlg1.num="1150" Or Dlg1.num="1163" Or Dlg1.num="13" _

Then

kbs = kbs & "1. Eligibility" kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

ElseIf Dlg1.num="1306" Or Dlg1.num="1311" Or Dlg1.num="1316" Or Dlg1.num="1325" Or Dlg1.num="1328"_ Or Dlg1.num="1331" Or Dlg1.num="1333" Or Dlg1.num="1345" Or Dlg1.num="1348" Or Dlg1.num="1350"_ Or Dlg1.num="1363" Or Dlg1.num="16" Or Dlg1.num="1606" Or Dlg1.num="1611" Or Dlg1.num="1613"_ Or Dlg1.num="1625" Or Dlg1.num="1628" Or Dlg1.num="1631" Or Dlg1.num="1633" Or Dlg1.num="1645"_

Then

kbs = kbs & "1. Eligibility; 2. Check other stuff." kbs = kbs & " Please clike OK to enter instruction once you finish reviewing the file."

Else kbs = "Invalid Input."

End IF

response = MsgBox ( kbs , MB_OKCANCEL , "PLUA Check Points" )

If response = IDCANCEL Then Exit Sub End If

Again, thx!


#Rumba

YOU ARE THE BEST!!! made my day. Thanks and have a great weekend.