Topic: add new record with one click on a button

Hi,
I just searched for it but not manage to find anything.

I have a table with only two fields one integer and another one is calculated.
calculated fiel just count the child items.

so I don't need a new form to add new parent (in my case level). all I need is to know how can I add a new row in database and of course remove it from level manager with only one button without need to open a new form.

I want to add a new level (as example level 2) with one click. and of course with auto increment.
Also need to delete levels without select one of them from the grid, if user click on delete just remove the last one (bigger one)

many many Thanks

Re: add new record with one click on a button

Any Idea?

Re: add new record with one click on a button

sonixax,
.
Without seeing your project and from my interpretation of your request, I would suggest experimenting with a `record_count` field to keep track of the items in your database.  I had forgotten about this until recently, and it has solved many issues for me.
.
I'm not sure if I can provide a solution for your request, but adding a sample of what you're working with will certainly get a faster response.  Just my two cents.

"Energy and persistence conquer all things."

Re: add new record with one click on a button

joshuA wrote:

sonixax,
.
Without seeing your project and from my interpretation of your request, I would suggest experimenting with a `record_count` field to keep track of the items in your database.  I had forgotten about this until recently, and it has solved many issues for me.
.
I'm not sure if I can provide a solution for your request, but adding a sample of what you're working with will certainly get a faster response.  Just my two cents.


Thanks a lot that helps a lot.
I just used this query and everything seems fine.

INSERT INTO levels (level) VALUES ((SELECT COUNT(levels.id) FROM levels)+1)

one more question:

any Idea how to translate
mbyes and mbno

??

Many Thanks

Re: add new record with one click on a button

sonixax,
See if the attached is the sort of thing you are looking for.  Although the project is called Formless_add it actually is not formless. It just uses the opening form to save the record with the record counter and SAVE button hidden. The DELETE button removes the last record.

Post's attachments

Attachment icon Formless Add.zip 336.21 kb, 203 downloads since 2021-10-04