R
Roderick O'Regan
I've created a form with just one field that a user needs to complete. When
the commandbutton OK is selected it places the text written in the field
into a document.
However, I want the userform not to unload but to display again if the user
does not enter anything - merely presses the OK button.
Here is what I've written:
MainTitle = txtMainTitle
If MainTitle = "" Then
frmMainHeading.Hide
Unload frmMainHeading
'Reload it
frmMainHeading.Show
Load frmMainHeading
ElseIf MainTitle <> "" Then
frmMainHeading.Hide
Unload frmMainHeading
End If
This, of course appears to be wrong as it seems to go into some sort of
loop.
Any ideas, please, on how this could be made to work correctly?
Thanks
Roderick O'Regan
the commandbutton OK is selected it places the text written in the field
into a document.
However, I want the userform not to unload but to display again if the user
does not enter anything - merely presses the OK button.
Here is what I've written:
MainTitle = txtMainTitle
If MainTitle = "" Then
frmMainHeading.Hide
Unload frmMainHeading
'Reload it
frmMainHeading.Show
Load frmMainHeading
ElseIf MainTitle <> "" Then
frmMainHeading.Hide
Unload frmMainHeading
End If
This, of course appears to be wrong as it seems to go into some sort of
loop.
Any ideas, please, on how this could be made to work correctly?
Thanks
Roderick O'Regan