vb6 check to see if textbox is empty -
there similar question c#, check if textbox empty , return messagebox?.
there solution check if textbox empty https://www.daniweb.com/software-development/visual-basic-4-5-6/threads/414651/checking-if-textbox-is-empty, works if going check textbox in form. check textbox in form if empty or not.
i've written code check if textboxes empty
private sub checkempty() if text1.text = "" or text2.text="" blank = true end if end sub
then added code command button
private sub command1_click() checkempty if blank = true msgbox "a text box empty" else msgbox "text box has text" end if end sub
the problem when start program gives output "text box has text"
if there no text in text boxes.
what wrong code?
you need change procedure function returns value (i'd change name @ same time make more clear does).
private function anytextboxempty() boolean anytextboxempty = text1.text = "" or text2.text = "" end function private sub command1_click() if anytextboxempty msgbox "a text box empty" else msgbox "text box has text" end if end sub
Comments
Post a Comment