Very simple button tasks (Base form)

Dear all,

I just want to include a button in a Base form that performs a couple of simple tasks. I’ve been reading about Basic programming in LibreOffice Base, but, in the first place, there is too much information to learn for so little things that I want; in the second place I have found nowhere explaining the actions I want to take.

The use of the button would be extremely simple: it should make visible another control in the form, and then it should go to a random register. That’s all.

Anyone could help me with this?

Thanks a lot.


Do you mean

sub onBtnClick(oEvent)
Dim form, cntrl
  form = oEvent.Source.Model.Parent
  cntrl = form.getByName("nameOfControlHideOrVis")
  cntrl.setPropertyValue("EnableVisible", True)                    ' Set visible
'  cntrl.setPropertyValue("EnableVisible", not cntrl.EnableVisible) ' Revert 
end sub

Yes, it works. Thanks!

Is using code like this the only way to construct a useable data base in base?