Click here to Skip to main content
15,897,187 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: inheriting values among forms Pin
nlarson1112-Mar-07 5:00
nlarson1112-Mar-07 5:00 
AnswerRe: inheriting values among forms Pin
Christian Graus12-Mar-07 5:07
protectorChristian Graus12-Mar-07 5:07 
Questionneed help on admin access login screen Pin
peteyshrew12-Mar-07 3:10
peteyshrew12-Mar-07 3:10 
Questionconvert string into date format Pin
Pushpa Setty12-Mar-07 2:16
Pushpa Setty12-Mar-07 2:16 
AnswerRe: convert string into date format Pin
Kschuler12-Mar-07 8:04
Kschuler12-Mar-07 8:04 
GeneralRe: convert string into date format Pin
Dave Kreskowiak12-Mar-07 8:25
mveDave Kreskowiak12-Mar-07 8:25 
GeneralRe: convert string into date format Pin
Kschuler12-Mar-07 8:30
Kschuler12-Mar-07 8:30 
AnswerRe: convert string into date format Pin
Dave Kreskowiak12-Mar-07 8:42
mveDave Kreskowiak12-Mar-07 8:42 
Pushpa Setty wrote:
If sDate = DateTime.ParseExact(strDate, "yyyyMMdd", formatNew) Then


This won't work as, unlike C++ or C#, you're not assigning anything to sDate. You're actually comparing a date object (Jan 1, 0001) to the date object returned by the DateTime.Parse, which will, in all likelyhood, be false every single time.

It should work, and be a little more flexible, if you did something like:
Public Shared Function CheckDateFormat(ByVal dateToCheck As String, ByVal culture As CultureInfo) As Boolean
    Try
        DateTime.ParseExact(dateToCheck, "yyyyMMdd", culture)
        Return True
    Catch
        ' Your function shouldn't care about other controls on the form.
        ' It's up to the caller to decide what should be done, like post a message,
        ' when this function returns False.
        Return False
    End Try
End Function

Mind you, this will only check to see if the date is legal on the Gregorian Calendar. It won't check to see if the date is within a legal range for your applications data.


Dave Kreskowiak
Microsoft MVP - Visual Basic


Question(VB.NET)clearing all controls in the form by calling a function Pin
venkata lakshmi prasanna12-Mar-07 1:37
venkata lakshmi prasanna12-Mar-07 1:37 
AnswerRe: (VB.NET)clearing all controls in the form by calling a function Pin
Mogtabam12-Mar-07 1:46
Mogtabam12-Mar-07 1:46 
AnswerRe: (VB.NET)clearing all controls in the form by calling a function Pin
Parwej Ahamad12-Mar-07 2:00
professionalParwej Ahamad12-Mar-07 2:00 
Questiondisplaying datagrid row data in to specific textboxes Pin
venkata lakshmi prasanna12-Mar-07 1:33
venkata lakshmi prasanna12-Mar-07 1:33 
AnswerRe: displaying datagrid row data in to specific textboxes Pin
jhoga12-Mar-07 4:26
jhoga12-Mar-07 4:26 
QuestionDatagrid using Combo box and Textbox............... Pin
somagunasekaran12-Mar-07 1:12
somagunasekaran12-Mar-07 1:12 
AnswerRe: Datagrid using Combo box and Textbox............... Pin
Mogtabam12-Mar-07 1:33
Mogtabam12-Mar-07 1:33 
GeneralRe: Datagrid using Combo box and Textbox............... Pin
somagunasekaran12-Mar-07 1:42
somagunasekaran12-Mar-07 1:42 
GeneralRe: Datagrid using Combo box and Textbox............... Pin
Mogtabam12-Mar-07 2:58
Mogtabam12-Mar-07 2:58 
QuestionResize of Form according to System Resolution Pin
Priya_200711-Mar-07 23:46
Priya_200711-Mar-07 23:46 
AnswerRe: Resize of Form according to System Resolution Pin
Mogtabam12-Mar-07 0:44
Mogtabam12-Mar-07 0:44 
AnswerRe: Resize of Form according to System Resolution Pin
sathish s12-Mar-07 1:18
sathish s12-Mar-07 1:18 
AnswerRe: Resize of Form according to System Resolution Pin
Priya_200712-Mar-07 1:29
Priya_200712-Mar-07 1:29 
GeneralRe: Resize of Form according to System Resolution Pin
Mogtabam12-Mar-07 1:38
Mogtabam12-Mar-07 1:38 
GeneralRe: Resize of Form according to System Resolution [modified] Pin
M-Hall12-Mar-07 5:38
M-Hall12-Mar-07 5:38 
Questionvbscript code needed Pin
SailajaMantha11-Mar-07 20:47
SailajaMantha11-Mar-07 20:47 
GeneralRe: vbscript code needed Pin
Guffa12-Mar-07 1:09
Guffa12-Mar-07 1:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.