Force answer to input box

I’m trying to force the user to provide an answer to an input box by using a while loop. I have

	While isBlank(sAnswer) 'Force the user to enter something for a reason for rejecting a data set. 
 		sAnswer = InputBox("What is the reason for rejecting the data set?", "Question:")
 		sAppend = " - " & sAnwer

The line starting with “While” keeps throwing:

BASIC runtime error.
Sub-procedure or function procedure not defined.

I have no idea what’s wrong. I think my why loop follows the syntax on the help page for while…wend

I don’t know if it’s relevant, but you have spelt sAnswer wrong on line 3 (“sAnwer”).

Did you declare the variable at the beginning of the procedure with a statement like

Dim sAnswer As String?

I just fixed it, and still no joy. Thanks for catching that. It would have caused problems later.

Yes, I made sure to declare all my variables.

OMG! Is it your function? Or you think that Basic has it?

Do you mean sAnswer=""?

1 Like

Good point. I shall switch it to your suggestion.