i've always used this in visual basic
...
if trim(textbox1.text) = "" then
msgbox "you need to enter something in the textbox!"
else
doprintfunction() '/ your print function code here
end if
...
Similar to the above, but its just what i've always used