“BASIC runtime error. An exception occurred Type: com.sun.star.lang.IllegalArgumentException Message: arguments len differ!.” Both type Integer–any suggestions?
I’m trying to select an item from a list box and transfer that value to a field in a table. Code follows:
Option Explicit
Global oForm, oControl As Object
Global ShowInt as Integer
Sub SetControlStr(FrmNam, CntrlNam, NewStr As String)
oForm = ThisComponent.DrawPage.Forms.GetByName(FrmNam)
oControl = oForm.GetByName(CntrlNam)
oControl.SetPropertyValue(NewStr)
End Sub
Sub SetControlInt(FrmNam, CntrlNam As String, NewInt As Integer)
oForm = ThisComponent.DrawPage.Forms.GetByName(FrmNam)
oControl = oForm.GetByName(CntrlNam)
oControl.SetPropertyValue(NewInt)
End Sub
Sub ExecuteAction_AccountListBox
oForm = ThisComponent.DrawPage.Forms.GetByName(“LogQueryForm1”)
oControl = oForm.GetByName(“lstAccountListBox”)
ShowInt = oControl.ValueItemList(oControl.SelectedItems(0))
MsgBox ShowInt,0,“AccountListBox” 'Just for debugging
IF ShowInt = 1 Then 'New Account
Call SetControlStr(“LogQueryForm1”, “fmtAccountID”, “”)
Call SetControlStr(“LogQueryForm1”, “txtAccountCompany”, “”)
Call SetControlStr(“LogQueryForm1”, “txtAccountNbr”, “”)
Call SetControlStr(“LogQueryForm1”, “txtAccountTyp”, “”)
Call SetControlStr(“LogQueryForm1”, “txtAcctDescrit”, “”)
Else 'Transfer list AccountID to AcctID
Call SetControlInt(“LogQueryForm1”, “fmtAcctID”, ShowInt) ’ ← Error comes here
EndIf
End Sub