Lazarus

Programming => Databases => Topic started by: kito on August 01, 2021, 12:31:27 am

Title: inserting new record while dataset is filtered
Post by: kito on August 01, 2021, 12:31:27 am


Hello

here is the thing :
employees dataset filtered by a selectable department name and displayed in  dbgrid
I am trying to insert than edit  the  new record directly on the dbgrid (filter is ON) it ends
usually by corrupting the database .  :(
and no wonder because the department field is null, so I decided to set the department Value once the record is inserted to avoid the mess .


my question is: how bad is applying this method?  what do you recommend in similar situations where the client demand that inserting data must be in the dbgrid while the list is limited to employees in the same department!
Title: Re: inserting new record while dataset is filtered
Post by: mangakissa on August 02, 2021, 11:40:09 am
It's the only possible way. Because the dataset is filtered you know the value of the department. So filling the field before the record is saved is normal.
Title: Re: inserting new record while dataset is filtered
Post by: kito on August 02, 2021, 05:08:25 pm
It's the only possible way. Because the dataset is filtered you know the value of the department. So filling the field before the record is saved is normal.
I thought that I was the owner of the invention  :D  :D  :D  , yet it is nice to be on the right path despite its difficulty. Thank you very much for your time in reading and responding to the topic.
TinyPortal © 2005-2018