Thanks Tolgag... you're the man... It's finally working
final code:
Private Sub CommandButton1_Click()
'....loses focus of textbox
Me.TextBox1.Enabled = CBool(Me.TextBox1.Value = "")
Me.TextBox2.Enabled = CBool(Me.TextBox2.Value = "")
Me.TextBox3.Enabled = CBool(Me.TextBox3.Value = "")
'....if user leaves a textbox blank triggers messagebox and sets focus
if user completes everything then locks textbox and saves. Nice Tolgag
If Me.TextBox1 < "" And Me.TextBox2 < "" And Me.TextBox3 < "" Then
ActiveWorkbook.Save
Else
MsgBox "Unable to book"
Me.TextBox1.Enabled = True
Me.TextBox2.Enabled = True
Me.TextBox3.Enabled = True
End If
End Sub
:) nrage21 <= happy camper!
--
Message posted from
http://www.ExcelForum.com