I have created a Userform with different date fields and descriptions fields.
I want to validate the input fields before sending a message, and have created the following macro.
--------------------------------------
DIM TxBeskr as String
DIM TxStart as Date
DIM TxEnd as Date
DIM TxWBS as String
--------------------------
Private sub command_Send_message()
If TxStart > "" And TxEnd > "" And TxWBS > "" And TxBeskr > "" Then
If IsDate(TxStart) = True Then
If IsDate(TxEnd) = True Then
etc
End if
msgbox "You have not entered any data in the userform"
-----------------------------------------------
The problem ist that the first IF/AND statment does not work.
If there has been no values registred in the userform, it should just go to end if and show the message.
BUT. If there has been values registred, the next step should be If IsDate... But it does not recognize the values in the userform and goes directly to the End IF of the first IF statement.
It is it a problem with the variables and declarations?
I want to validate the input fields before sending a message, and have created the following macro.
--------------------------------------
DIM TxBeskr as String
DIM TxStart as Date
DIM TxEnd as Date
DIM TxWBS as String
--------------------------
Private sub command_Send_message()
If TxStart > "" And TxEnd > "" And TxWBS > "" And TxBeskr > "" Then
If IsDate(TxStart) = True Then
If IsDate(TxEnd) = True Then
etc
End if
msgbox "You have not entered any data in the userform"
-----------------------------------------------
The problem ist that the first IF/AND statment does not work.
If there has been no values registred in the userform, it should just go to end if and show the message.
BUT. If there has been values registred, the next step should be If IsDate... But it does not recognize the values in the userform and goes directly to the End IF of the first IF statement.
It is it a problem with the variables and declarations?