Ask Your Question
0

Open entry in form

asked 2018-03-21 00:54:23 +0200

updated 2018-03-21 00:57:43 +0200

Hello,
so I have my testing database of people:
image description

From that database I created query to show only relevant columns:
image description

For editing people I created form:
image description


Now my question:
After I find some person using the created Query, how can I open it in the form to edit it comfortably?

I would expect "Right click -> Open in form-person" or something in the query result.

Thank you for advice.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-03-21 02:04:21 +0200

Ratslinger gravatar image

updated 2018-03-21 03:06:21 +0200

Hello,

I believe you have some misconceptions about what is needed to update records. Let's just use your images.

In your table you have four fields: id, name, surname and note. Of note is the Key field here - id. The is a unique key which allows access to the record.

In the Query, you select all fields EXCEPT the most important one - the Key field id.

Now when you get to the form you have no way of actually accessing the actual table record which requires a Key field. Instead you simply have a list of information gathered from the table through a query.

If you were to add the id field to the query & the form it would work but makes no sense since it is just a duplicate of the table itself. However, when creating new records or updating/modifying existing records you typically need the entire record present to fulfill the fields in the record.

With all that, if you simply want to select a record based upon a piece of information, you can do that with a list box and a table filter. There is a sample in my answer on this post display specific record in a form which demonstrates this & in the same answer another link to more info on filtering.

Here is a more complex sample which includes a sub form and optional for not using filter but rather a macro Macro wich auto fill form #BASE.

You may also be interested in the Base documentation found here - LibreOffice Documentation/Publications

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

Thank you for the answer. But your sample doesn't do what I need:

  1. I opened "EMPLOYEES" table.
  2. I selected entry with ID 5 and then clicked to "Edit data" button.
  3. No form was open. Just inline edit.

https://i.imgur.com/yDof09B.png

I need an easy way how to list data, and from that list open editing form for one selected entry.

nanuqcz gravatar imagenanuqcz ( 2018-03-21 06:47:28 +0200 )edit

@nanuqcz You did not open a form. You opened a table. There is no method to open a form from a table list. Look in the Forms section of that .odb file. Open the CompanySelectionNoMacro form. Use the list box to select the company wanted. Press the button & that company record appears where you can edit it. This is a more complex form. Once the company is selected, it also lists the employees on for the company on the grid below. You can edit them in the grid.

Ratslinger gravatar imageRatslinger ( 2018-03-21 11:51:02 +0200 )edit

If you do not understand these methods, please read some of the documentation pointed to. Look especially near the top for the Getting started with Base document. It will present a better overall process of Forms & tables.

You may be better off looking at the first example I pointed to as it is more basic.

Ratslinger gravatar imageRatslinger ( 2018-03-21 11:53:32 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-03-21 00:54:23 +0200

Seen: 74 times

Last updated: Mar 21 '18