1

I've two Input Fields and Two Submit Button on a page. InputField1 "Code" InputField2 "Amount" Button1 "Save" Button2 "Save And Add Another"

Having trouble writing the logic. i should only hit save when i've only one item item and move on. if mutltiple then i need to hit button2 and follow the process and at the end i need to hit save. Any help will be highly apreciated. I'm just not sure how do i handle the save button.

sCode="100:500"
sAmount="500:500"
arrCCode=Split(sCode,":")
arrAmount=Split(sAmount,":")

For i = 0 To UBound(arrCCode)

  If i > UBound(arrCCode) Then
    Exit For
    Else 
        MsgBox arrCCod(i)
        MsgBox arrAmount(i)


  End If
Next

1 Answer 1

1

I think i got it,,,

sCode="100:500"
sAmount="500:500"
arrCCode=Split(sCode,":")
arrAmount=Split(sAmount,":")

For i = 0 To UBound(arrCCode)

  'If i > UBound(arrCCode) Then
    'Exit For
    'Else 
        MsgBox arrCCod(i)
        MsgBox arrAmount(i)
        If i = UBound(arrCCod) Then
            msgbox "Save"
            Exit For
        Else
            Msgbox "Save and add"
        End 

  'End If
Next
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.