Announcement

Collapse
No announcement yet.

what does vbnullstring do?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • what does vbnullstring do?

    I "stole" this format from an old thread.......It has to check if the dateformat is correct in the textbox......does the job perfect.....just for my understanding....what does the first equation do? Don't get this nullstring?

    Code:
    Private Sub txtbRolldate_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    
    'checks if the date is the right format
    
    If txtbRolldate = vbNullString Then Exit Sub
    If Not IsDate(txtbRolldate) Then
        MsgBox "Invalid date format. Please use 'dd-mm-yy' only"
        txtbRolldate = vbNullString
        Cancel = True
    Else
        txtbRolldate = Format(txtbRolldate, "dd-mm-yy")
    End If
    
    
    
    End Sub

  • #2
    if nothing has been entered into the text box, exit the sub and presumably the user can try again. vbNullString is a built-in vb constant which is used to check for any empty string.

    Comment


    • #3
      thank you very much........helped on my understanding

      Comment

      Working...
      X