in the lines
txtRefernce=Entry(f1,font=('arial', 16,'bold'),    
textvarible=rand, bd=10, 
insertwidth=4,bg="powder blue", justify='right')
You forgot an A in the textvariable param
txtRefernce=Entry(f1,font=('arial', 16,'bold'), 
textvariable=rand, bd=10, 
insertwidth=4,bg="powder blue", justify='right')
The error is in the -textvariable param
try correcting this part
ALSO in the 195th line you forgot a # in the #ffffff color
it worked just fine when I corrected it here.
2
solved tkinter code showing unexpected behavior