Really the problem is not with tkinter, but at the time of registering the data in the database, it is not executed in try:, but the except: that shows the unregistered mess