Deleting table Record from Listbox

Dummy

Dummy User
Local time
Today, 07:53
Joined
Mar 7, 2005
Messages
25
hi,

I have in an unbound form a List box with Row SOurce of EmployeeName from a table,

im selecting one of the names of the employee and loading form of specified Employee name using filters

I want to create a command button to delete the selected EMployee Name from the list Box (which in its turn deleting All its related records in its table) , and while clicking the delete button, Msgbox asking me to confirm Delete, can somebody help me coding behind this On Click Event of this command button if it is possible?

Thanks in advance
 
Are you sure you want to delete the Employee as opposed to just having a field called LeavingDate or something? If this person is linked in to other parts of the database you could find historical numbers changing.
 
you said something right, i dont want to delete the EmployeeName, but i asked the question generally since when i get the code i can use it for good purpose.

i have put other command in this Unbound form to open a Form for new record entry,
and lets say the user clicked it wrongly and a new blank form opened, and this Returned a Value of Employee Name as Blank to the List i talked about.

I tried to put a command button in the loaded form To delete the Record just opened it didn't worked out, i did it by wizard to delete record, maybe i just needed more coding im not sure

So what im thinking is eighter to delete the blank names from first form, with msgbox asking for confirmation

Or to delete the record just opened again asking for confirmation

i disabled the navigation buttons in the new opened form, so that i reduce the blank new records
 

Users who are viewing this thread

Back
Top Bottom