If item_code, qty, item_rate and item_tax are unique then they don't have to be qualified (as in with a. or b. but it is good practice to qualify them anyway for clarity.
You didn't give the entire line of code. You are building a string query but I can't see the assignment or even the opening quotes so I can't speak as to syntax. You also need to surround text values in single quotes. I find it helps to format query strings so each portion of a clause is on its own line. It makes it easier to read and spot syntax errors. Replace the ?. in the following with the appropriate qualifiers (a., b.) and try
query = "insert into po_detail (item_code,qty,item_rate,item_tax)" _
& " select a.item_code, ?.qty, ?.item_rate, ?.item_tax" _
& " from mr_detail a, mr_head b" _
& " where a.mr_no = b.mr_no" _
& " and a.mr_no = '" & combo_mr_no.Text & "'"
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: