I am able to access the database and populate the listbox but unable to conduct a search based on text in the Entry String.
def find_roster(num_input):
global cursor
cursor.execute("""SELECT num, firstname, surname, duty FROM active WHERE num='%s'""" %(num_input))
rows = cursor.fetchall()
dbi.close()
for results in rows:
rosterList.insert("end", results)
return rows
numLabel=Label(root, text="Employee #")
numLabel.grid(row=0,column=0)
findButt=Button(root, text="Find", width=12, command=find_roster)
findButt.grid(row=1, column=5)
num_input=StringVar()
num_input=Entry(root,textvariable=num_input)
num_input.grid(row=0,column=1)
I have selected the specific syntax
Here is the error: TypeError: find_roster() missing 1 required positional argument: 'num_input'
I appreciate any direction.