Hi, I'll learn more. You cant expect me to learn these things quickly since I don't have enough programming basics.
I want to ask why the above code can't update dbgrid:
The sql works fine in SQLite Manager but when I run program and click the nationalities grid, it clears quotes grid while I'm expecting to select specific records. How can I update dataset and assign it to dbgrid?
Your original project was not designed to have editable grids. Check my Insert Button example. It shows a "manual" insert. You can transform it into a manual update.
You don't need a MouseDown event so far. Start using simple buttons to make your update work, then you can experiment events.
For an editable grid there are some rules you must follow, as you have already studied in Lazarus tutorials. Walk first, fly next. Not the contrary.