@JonB thanks Jon
Where would I put your suggestions in my code?
import ui
v = ui.load_view()
name = ""
def tf_action(sender):
global name
button1= ui.Button(action = tf_action)
button1.action = tf_action
v=ui.load_view()
v.present('sheet')
Thanks simon