My friend ask me to make some small app based on free tables. He planned to use this app for mass processing data, i.e. he'll read them from papers and enter via form into tables. I wish to suppress him to enter same value twice or more times. I planned to make some routine which will check two situation:
1) new record adding: when he click Save button check is there already in the table same value (field Salesman) as value filled in form; if not exist such value then add it into table or pop up messagebox with error message
2) editing existing record: in moment when he push Save button check is there any record with same value except this one; if yes pop up error, if not then save it
I tried it to "hide" inside cmdAdd.Click() event but wasn't successful. I tried it distinguish add mode and edit mode and navigation mode based on buttonset1.addmode and buttonset1.editmode but I didn't got working solution...
Is there some clean code that could perform this task? Thank you.
There is no good nor evil, just decisions and consequences.
1) new record adding: when he click Save button check is there already in the table same value (field Salesman) as value filled in form; if not exist such value then add it into table or pop up messagebox with error message
2) editing existing record: in moment when he push Save button check is there any record with same value except this one; if yes pop up error, if not then save it
I tried it to "hide" inside cmdAdd.Click() event but wasn't successful. I tried it distinguish add mode and edit mode and navigation mode based on buttonset1.addmode and buttonset1.editmode but I didn't got working solution...
Is there some clean code that could perform this task? Thank you.
There is no good nor evil, just decisions and consequences.