title: Sending Given Inputs to Database by using MongoDB
body: <p>I am designing an application by using MongoDB and Tkinter. I am trying to take inputs from user and send them to the database.
  Here is my code</p>
  <pre><code>def inputFunc():
      inputWindow = Tk()
      inputWindow.title(&quot;Müşteri Ekleme Ekranı&quot;)
      inputWindow.geometry(&quot;500x500&quot;)
      
      submitButton = Button(
          inputWindow,
          text = &quot;Müşteriyi Ekle&quot;,
          width = 30,
          height = 5,
          fg = &quot;DarkOrange1&quot;,
          bg = &quot;green3&quot;,
          command = addClientFunc)
      submitButton.place(x=150,y=350)
      
      c_id = Label(inputWindow, text = &quot;Müşteri Numarası&quot;).place(x = 30,y = 50)
      c_name = Label(inputWindow, text = &quot;Müşteri Adı&quot;).place(x = 30,y = 70)  
      c_firmName = Label(inputWindow, text = &quot;Firma Adı&quot;).place(x = 30,y = 90)
      address = Label(inputWindow, text = &quot;Adres&quot;).place(x = 30,y = 110)
      engine = Label(inputWindow, text = &quot;Motor Markası&quot;).place(x = 30,y = 130)
      power = Label(inputWindow, text = &quot;Motor Gücü&quot;).place(x = 30,y = 150)
      phoneNumber = Label(inputWindow, text = &quot;Telefon Numarası&quot;).place(x = 30,y = 170)
      email = Label(inputWindow, text = &quot;E-mail&quot;).place(x = 30, y = 190) 
      workHour = Label(inputWindow, text = &quot;Çalışma Saati&quot;).place(x = 30,y = 210)
      
      idEntry = Entry(inputWindow).place(x = 180, y = 50)
      nameEntry = Entry(inputWindow).place(x = 180, y = 70)
      firmNameEntry = Entry(inputWindow).place(x = 180, y = 90)
      addressEntry = Entry(inputWindow).place(x = 180, y = 110)
      engineEntry = Entry(inputWindow).place(x = 180, y = 130)
      powerEntry = Entry(inputWindow).place(x = 180, y = 150)
      phoneNumberEntry = Entry(inputWindow).place(x = 180, y = 170)
      emailEntry = Entry(inputWindow).place(x = 180, y = 190)
      workHourEntry = Entry(inputWindow).place(x = 180, y = 210)
      
  def addClientFunc():
      ins_table_Clients.insert_one({
          &quot;c_id&quot;: idEntry.get(),
          &quot;c_name&quot;: nameEntry.get(),
          &quot;c_firmName&quot;: firmNameEntry.get(),
          &quot;address&quot;: addressEntry.get(),
          &quot;engine&quot;: engineEntry.get(),
          &quot;power&quot;: powerEntry.get(),
          &quot;phoneNumber&quot;: phoneNumberEntry.get(),
          &quot;email&quot;: emailEntry.get(),
          &quot;workHour&quot;: workHourEntry.get()
      })  
  </code></pre>
  <p>I am getting an error which says idEntry is not defined. First I thought that is about making idEntry global but that didn't work. What can I do to fix that? Appreciated for your helps.</p>