Ask Your Question
0

Radio button actuating a text box

asked 2018-06-18 21:33:25 +0100

JUSTROB gravatar image

Is it possible to create a radio button and when it is checked have it open a text box? I'd like to have a Married yes/no radio button that if clicked it will drop down a Spouse Name text box and add the spouse's name to the database.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-06-19 00:37:25 +0100

Ratslinger gravatar image

updated 2018-06-19 23:53:43 +0100

Hello,

You can sort of do this using macro code. You can set the Visible property of the text field to Yes or No depending upon the setting of the radio button group (use group so only one selection allowed). If you know macros this is fairly simple. If not, learning to code macros is quite a task. Many thing to cover especially in Base.

Personally, I am not sure of the benefit. If you select Yes but don't enter a name, what then? You can always use SQL (a query) to check for records with incorrect entries such as: Married set but spouse = NULL (or vice versa).

Edit 2018-06-19:

To illustrate a working sample with macro ------ RadioButton.odb

For information on coding macros there are many sources such as the LO docs -> LibreOffice Base Handbook.

The most definitive source for macros is OpenOffice Macros Explained (OOME) by Andrew Pitonyak found here -> OOME PDF.

For more, see this post -> To learn LibreOffice Base are there introductions or tutorials?

If this answers your question please tick the ✔ (upper left area of answer). It helps others to know there was an accepted answer.

edit flag offensive delete link more

Comments

I found Access2Base->PropertiesSet->setVisable but now how can I edit it? I write C code for microprocessors so I'm kind of falling back on that.

I would think when the Married Radio button changes state I need to 1st, see if the button is set or cleared then 2nd, if it is set I setVisible the SpouseName field. If the radio button is cleared I want to clear the text value of SpouseName then clear the Visible property of the SpouseName field.

Is this how I'd do it?

Thanks

JUSTROB gravatar imageJUSTROB ( 2018-06-19 20:53:03 +0100 )edit

I'm not finding anything on how to write macros for libreoffice base.

JUSTROB gravatar imageJUSTROB ( 2018-06-19 20:54:20 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-18 21:33:25 +0100

Seen: 75 times

Last updated: Jun 19 '18