I don't know why I left out the Me.txtRef in front of .Value
Me.txtRef.Value = UCase(Me.txtRef.Value)
Or, slightly faster...
With Me.txtref
   .Value = UCase(.Value)
End with
Anyway, I'm glad you got it working