Click here to Skip to main content
15,921,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: shortcuts Pin
Tom Deketelaere2-Aug-07 9:53
professionalTom Deketelaere2-Aug-07 9:53 
Questioncount of rows in datarow Pin
SamRST2-Aug-07 3:17
SamRST2-Aug-07 3:17 
AnswerRe: count of rows in datarow Pin
ctlqt122-Aug-07 3:36
ctlqt122-Aug-07 3:36 
GeneralRe: count of rows in datarow Pin
SamRST2-Aug-07 3:52
SamRST2-Aug-07 3:52 
GeneralRe: count of rows in datarow Pin
ctlqt122-Aug-07 4:04
ctlqt122-Aug-07 4:04 
Questionsend data from listbox to an array variable Pin
sixecho2-Aug-07 2:28
sixecho2-Aug-07 2:28 
AnswerRe: send data from listbox to an array variable Pin
Tom Deketelaere2-Aug-07 2:44
professionalTom Deketelaere2-Aug-07 2:44 
QuestionCalculating employee age Pin
x-Taka-x2-Aug-07 1:43
x-Taka-x2-Aug-07 1:43 
Hi there..
Im trying to write an application that calculates an employee's age. The user needs to enter the day, month and year separately into provided textboxes..
Within the button_click event:
Dim FirstDate As String
Dim SecondDate As Date
Dim pAge As Long

FirstDate = (txtDay.Text & txtMonth.Text & txtYear.Text)
SecondDate = CDate(FirstDate)

pAge = DateDiff(DateInterval.Day, Now, SecondDate)
MsgBox (pAge)

Please can someone tell me if this piece of code is correct... im also getting an error, stating :
"Exception System.InvalidCastException was thrown in debuggee:
Conversion from string "02121980" to type 'Date' is not valid."

02121980 is the day, month, year entered into textboxes.
Please help!
Thanks

AnswerRe: Calculating employee age Pin
DA_Loring2-Aug-07 1:50
DA_Loring2-Aug-07 1:50 
AnswerRe: Calculating employee age Pin
_Damian S_2-Aug-07 2:03
professional_Damian S_2-Aug-07 2:03 
AnswerRe: Calculating employee age Pin
Tom Deketelaere2-Aug-07 2:06
professionalTom Deketelaere2-Aug-07 2:06 
GeneralRe: Calculating employee age Pin
Luc Pattyn2-Aug-07 7:38
sitebuilderLuc Pattyn2-Aug-07 7:38 
GeneralRe: Calculating employee age Pin
x-Taka-x2-Aug-07 8:53
x-Taka-x2-Aug-07 8:53 
GeneralRe: Calculating employee age Pin
x-Taka-x2-Aug-07 8:49
x-Taka-x2-Aug-07 8:49 
GeneralRe: Calculating employee age Pin
Tom Deketelaere2-Aug-07 9:54
professionalTom Deketelaere2-Aug-07 9:54 
AnswerRe: Calculating employee age Pin
The ANZAC2-Aug-07 11:14
The ANZAC2-Aug-07 11:14 
QuestionSearching a particular text Pin
Archana New to Dotnet2-Aug-07 1:37
Archana New to Dotnet2-Aug-07 1:37 
AnswerRe: Searching a particular text Pin
DA_Loring2-Aug-07 1:51
DA_Loring2-Aug-07 1:51 
AnswerRe: Searching a particular text Pin
Tom Deketelaere2-Aug-07 2:01
professionalTom Deketelaere2-Aug-07 2:01 
GeneralRe: Searching a particular text Pin
Archana New to Dotnet2-Aug-07 2:17
Archana New to Dotnet2-Aug-07 2:17 
GeneralRe: Searching a particular text Pin
Tom Deketelaere2-Aug-07 2:24
professionalTom Deketelaere2-Aug-07 2:24 
GeneralRe: Searching a particular text Pin
Luc Pattyn2-Aug-07 7:40
sitebuilderLuc Pattyn2-Aug-07 7:40 
AnswerRe: Searching a particular text Pin
The ANZAC2-Aug-07 11:19
The ANZAC2-Aug-07 11:19 
QuestionWriting data back to a table Pin
DA_Loring2-Aug-07 1:36
DA_Loring2-Aug-07 1:36 
AnswerRe: Writing data back to a table Pin
Mycroft Holmes3-Aug-07 15:07
professionalMycroft Holmes3-Aug-07 15:07 

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.