Hello,
Embarrasing - Am in need of L plates…
Win10, Lo6.4.5.2 HSQL2.51
I have a listbox which toggles taxrate after ItemStatusChanged, works ok, however can not figure out the macro for the forms onload event to read the selected value ?
listboxname = lstTaxIncExl
SELECT COALESCE ( “rate” || '% ’ || “txtype”, “txtype” ) “TYPE_PERCENT”, “sid” FROM “tblTaxRates”
Sub togglefields(oEvent)
Dim sTax As Integer
sTax = oEvent.Source.SelectedItem
If sTax = 0 Then
rem hide exclusive, show inclusive
oFormMain = ThisComponent.Drawpage.Forms.getByName("MainForm")
oFormSub = oFormMain.getByName("TaxIncExl")
oFormMain = ThisComponent.Drawpage.Forms.getByName("MainForm")
oFormSub = oFormMain.getByName("TaxIncExl")
ocontrol01= oFormSub.getByName("TaxInclusive")
ocontrol01.enableVisible = true
ocontrol02= oFormSub.getByName("TaxInclusiveLabel")
ocontrol02.enableVisible = true
ocontrol03= oFormSub.getByName("TaxExclusive")
ocontrol03.enableVisible = false
ocontrol04= oFormSub.getByName("TaxExclusiveLabel")
ocontrol04.enableVisible = false
ocontrol05= oFormSub.getByName("ttlinclusive")
ocontrol05.enableVisible = false
ocontrol06= oFormSub.getByName("ttlexclusive")
ocontrol06.enableVisible = true
End If
If sTax > 0 Then
rem hide inclusive
oFormMain = ThisComponent.Drawpage.Forms.getByName("MainForm")
oFormSub = oFormMain.getByName("TaxIncExl")
ocontrol01= oFormSub.getByName("TaxInclusive")
ocontrol01.enableVisible = false
ocontrol02= oFormSub.getByName("TaxInclusiveLabel")
ocontrol02.enableVisible = false
ocontrol03= oFormSub.getByName("TaxExclusive")
ocontrol03.enableVisible = true
ocontrol04= oFormSub.getByName("TaxExclusiveLabel")
ocontrol04.enableVisible = true
ocontrol05= oFormSub.getByName("ttlinclusive")
ocontrol05.enableVisible = true
ocontrol06= oFormSub.getByName("ttlexclusive")
ocontrol06.enableVisible = false
End if
end sub
How can I get the form to show the correct fields when calling the form?
Thanks for your thoughts