Ask Your Question
0

Could someone tell me how to link a spin button to a field, so a number in a table is incremented?

asked 2017-03-18 04:56:12 +0200

TpnyK gravatar image

I have a form in LO Base & want to add two spin buttons to update a record by one, depending on whether I win or lose against a particular game opponent. I put the buttons on a form, but can't see how to link them to the "Won" or "Lost' field. Any help would be appreciated. Details: LibreOffice Base. Latest. Windows 10

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2020-05-10 01:50:09 +0200

Adding the Numeric Field and making that field have a spin button is fine.

But if you have to calculate anything based on what's within that field--a numeric value for example--I have found that it's difficult to do that. If you need the "won" or "lost" field to be just a cell (with no form field within it) then you can add a Spin Button to an adjacent cell by using the Form Controls banner and clicking on the Spin Button clicking and dragging the area where you want the button to appear. To link the Spin Button to the "won" or "lost" cell you right click on the button and go to Control Properties, click the Data tab and enter the cell name of the cell you want to link the button to. Make sure to click out of the design mode so you can use the button. And that's pretty much it.

If this is incorrect someone please do post a correction to make it accurate as I'm still learning too. Thanks and good luck.

edit flag offensive delete link more

Comments

@KPS2019,

Thank you for posting. Always welcome.

What it appears you have missed in the question is that this deals with LO Base and a database table. It seems you are talking of a solution in Calc as you reference 'cells'.

Ratslinger gravatar imageRatslinger ( 2020-05-10 03:45:26 +0200 )edit

Ah. Thank you. I stand corrected. It just goes to show that when you're searching for a solution to a specific problem, all other things you see are cast in that light. I was searching for a Spin Button solution for cells in a table so that's what I saw and I did indeed miss the portion of the question involving Base.

Thank you for making the correction, Ratslinger.

KPS2019 gravatar imageKPS2019 ( 2020-05-10 04:47:33 +0200 )edit
0

answered 2017-03-18 05:29:15 +0200

Ratslinger gravatar image

The spin button is not meant to be used on its' own. What you are most likely looking for is already in the control or table column you are looking to increment. Of course this should be a numeric field control of some type. Go to the General properties of the control/table column and look for Spin Button property. Change from No to Yes. You can also set the increment/decrement value on that same form.

edit flag offensive delete link more

Comments

Thanks Ratslinger - but I can't see any Spin Button Yes/No property on either the control or the column in the table. On the spin button control is an option to change the increment/decrement value - but nowhere does it allow to link to a field in the table. If I open the table in edit mode & select the Won field (the one i want to increment) I can't see a Spin Button property. I'm using small integer, but have tried all the other numeric values. Am I missing something?

TpnyK gravatar imageTpnyK ( 2017-03-19 00:09:49 +0200 )edit

You are not to be looking at the table but at the control on the form.

If you are dealing with a table grid control, the columns are controls in themselves, otherwise you are dealing with individual controls. Either the column control or the individual control should be of type: Numeric Field, Formatted Field or Currency. Of those, probably a Numeric Field type is best. Those are the control types which have the spin button options. Get rid of your original Spin Button control.

Ratslinger gravatar imageRatslinger ( 2017-03-19 01:35:03 +0200 )edit

Also, if the existing control is not of the proper type, there is no need to delete it. Just right click and select Replace with and select the appropriate control.

Ratslinger gravatar imageRatslinger ( 2017-03-19 01:44:47 +0200 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2017-03-18 04:56:12 +0200

Seen: 983 times

Last updated: May 10