Topic: button show record clears txtbox default value

HI,

another problem,
when i click show record or doubleclick on tablegrid that clears default txtbox values

Re: button show record clears txtbox default value

Hi


Yes, this is normal program behavior. Before editing a record, form elements are cleared and filled with values from the database. To fill with your own values, use a script.

3 (edited by IgorMad 2025-01-27 20:09:33)

Re: button show record clears txtbox default value

know that but edit clears fields who are not in edit options, see att.

maybe i explained wrong

fields rabat and PDV

Post's attachments

Attachment icon Capture.PNG 119.78 kb, 13 downloads since 2025-01-27 

Re: button show record clears txtbox default value

Fields are cleared regardless of whether the component is linked to a database or not.
DefaultValue - Allows you to set the default value when creating a new record.

Re: button show record clears txtbox default value

any example how to my field ( Rabat and PDV )  stay with default number until i change it?

Re: button show record clears txtbox default value

Hi igor, Sparrow,
Sparrow has outlined how the basic functionality works so I'm a bit confused to what your exact problem is.
Perhaps if  you upload your project, it will help to clarify the issue.
Derek.

Re: button show record clears txtbox default value

Hi,
i attach my project,
has many things to do but i am still working on it

Post's attachments

Attachment icon IGMAv06.zip 652.32 kb, 22 downloads since 2025-01-29 

Re: button show record clears txtbox default value

Hi Igor,
Attached is a fix for the problem with default values not appearing in 'rabat' and 'PDV' (see in the script).
However, I've had a look at your project and I think there are basic design issues that you should consider before you develop your project any further.
A couple of things that I noticed (there are others);
1.  you have an 'operaters' table - does this mean that your project will be used by more than a couple of people at the same time?  You might want to consider using MYSQL rather than SQLite as your database (although if concurrency is not a major concern, you should be okay to stick with SQLite as your database).
2.  You have set up a relationship between the 'usluge' and 'stavke' tables in your data schema;  however, because of the way you have designed your forms (specifically 'formusluge'), this relationship is not being populated.
3.  There is a lot of duplication of fields in the 'usluge' and 'stavke' tables.  This may be intentional if you are using the information in 'usluge' as defaults but then want to change some of those defaults before populating the 'stavke' table.  But having fields (for example 'kolicina') in the 'usluge' table doesn't make any sense (unless you are also wanting to use it to monitor stock levels etc).  Another example is 'artikel' that appears in both tables - surely 'artikel' (and 'jedinicnaMjera') would be common to both 'usluge' and 'stavke'  tables otherwise why have a relationship between them in the first place.
4.  I understand that different items in the 'usluge' table can have different 'PDV' rates but would you have a different  'PDV' rate on the 'slavke' table for the same item?
5.  You need to re-do 'formusluge' - maintaining 'usluge' data and 'stavke' data not only on the same form but also using the same fields(!) is going to cause you a lot of problems.  Using a separate form for 'usluge' data will both simplify and fix a few problems.
6.  You have a 'napomena' field in the 'nalozi' table but this is not related to the 'napomena' table which doesn't seem to do anything.
7   Consider using 'editable tablegrids' for your 'look up' reference data (it gives your project a clearer structure, reduces the number of forms and is a lot quicker to write).  The 'kupci', 'operater', 'mjeseci', 'godina' and 'usluge' tables could all be managed this way.
As a general observation, your database design looks a bit as if you are using a 'relational database' (ie SQLite) in a non-relational way (we often see this when someone tries to replicate something that was previously done in a spreadsheet and while it can be done, it doesn't take full advantage of what a relational database can offer).
I appreciate that your project is still being worked on and some of the outstanding issues may be known to you.  But I'd strongly advise sorting out the above points before making any further progress.
Do not take any of the above points as critisisms;  trying to design quite a complicated requirement as your first MVD project is not easy and a lot of what you've managed so far is working okay.
Regards,
Derek.

Post's attachments

Attachment icon IGMAv06 - default values.zip 648.89 kb, 30 downloads since 2025-01-31 

Re: button show record clears txtbox default value

Thank you so much, ill start from your advice. Probably, I'll reach out again for advice.

Re: button show record clears txtbox default value

Hi,

i listen your advice

1.  only me or my wife will use it and not in same time, i like option to have it on USB and we can take it home and work from home when we are not in workshop
2.  i think now it is good? or i am wrong?
3. same Uslug/Artikl(item) have different price depending on quantity (količina) - example 100 pen - 1 €/piece, 200 pen - 0,90 €/piece
4. all items have same PDV(25%) but some invoices are VAT free (so i must not write PDV on invoice)in Napomena there are 3 choices for PDV free by our law
5. working to find what i doing wrong
6. i fill napomena table with data
7 . done as you said

can you point me to some example why i dont have Stavke in Računi like Stavke in Nalozi?

Thank you for your advice i hope i go in right direction.

Post's attachments

Attachment icon IGMAv071.zip 750.01 kb, 19 downloads since 2025-02-03