Yes using classes I find is the best way for working with GUI's
In the following modified version of your code, I have stored the entry's in dictionaries and shown access them in the save button event.
In the following modified version of your code, I have stored the entry's in dictionaries and shown access them in the save button event.
import tkinter as tk from tkinter import ttk ### Create tkinter window ### class App(tk.Tk): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.title("Bookkeeping") self.geometry("800x600") ### Add a Notebook to window ### self.home_screen = ttk.Notebook(self) self.home_screen.pack(fill="both", expand=1, pady=15) self.create_customer_tab() self.create_vendor_tab() ### Create Customers tab ### def create_customer_tab(self): self.customer_tab = TabFrame(self.home_screen) entry_boxes = ["Customer ID", "Name", "Address 1", "Address 2", "Address 3", "Address 4", "Email Address", "Phone 1", "Phone 2"] for detail_name in entry_boxes: self.customer_tab.create_entrys(detail_name) self.customer_tab.create_save_button() self.customer_tab.save_button.bind('<Button-1>', self.on_save_button) self.home_screen.add(self.customer_tab, text="Customers") ### Create Vendors tab ### def create_vendor_tab(self): self.vendor_tab = TabFrame(self.home_screen) for detail_name in ["Name", "Address 1", "Address 2", "Address 3", "Address 4", "Email Address", "Phone 1", "Phone 2"]: self.vendor_tab.create_entrys(detail_name) self.home_screen.add(self.vendor_tab, text="Vendors") def on_save_button(self, event): print('save clicked') entry_boxes = ["Customer ID", "Name", "Address 1", "Address 2", "Address 3", "Address 4", "Email Address", "Phone 1", "Phone 2"] for detail_name in entry_boxes: entry_value = self.customer_tab.entrys[detail_name].get() print(f'Entry {detail_name} = {entry_value}') ### Class to add tabs to Notebook with a method to add entry boxes and a save button ### class TabFrame(tk.Frame): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.pack(fill="both", expand=1) self.entrys = {} def create_entrys(self, detail_name): entry_box = tk.Entry(self) entry_box.grid(column=1) entry_box.insert(0, detail_name) self.entrys[detail_name] = entry_box def create_save_button(self): self.save_button = tk.Button(self, text="Save") self.save_button.grid(column=1) # Main app = App() app.mainloop()