Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Type() or empty() equivalent in VB
Message
De
16/07/2002 03:52:20
 
 
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00678902
Message ID:
00678987
Vues:
11
This message has been marked as the solution to the initial question of the thread.
Because in VB trere are no DateTime data type, you may speak for variable of Date data type (which can contain also time) or for Variant variable. Anyway, there IsDate() function, which you can use to check if entered value (including time) is valid Date:
Dim SampleDateTimeValue As Date
Dim IsValidDateTime As Boolean

  SampleDateTimeValue = DateSerial(2002, 12, 2) + TimeSerial(11, 34, 45)
  IsValidDateTime = IsDate(SampleDateTimeValue)  'Returns True
  SampleDateTime = CDate(txtDateTime.Text)
  If Not IsDate(SampleDateTimeValue) Then
    MsgBox "Please enter valid date and time!", vbExclamation + vbOKOnly, "Error"
  EndIf

Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000)

VB (.NET) - what other language do you need in the whole Universe?...

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform