Isn't that what you want to do?
(I have supposed NoName is a global variable.)
Or even simpler:
Function CheckForspaces() txt$=TextFieldText$(SiteNameField) ln% = Len(txt) For i = 1 To ln If Mid(txt, i, 1) <> " " Then NoName = False Return EndIf Next Notify "You MUST give it a name!" NoName=True End Function
(I have supposed NoName is a global variable.)
Or even simpler:
Function CheckForspaces() txt$=TextFieldText$(SiteNameField) NoName = (Trim(txt) = "") If NoName Then Notify "You MUST give it a name!" End Function