I have 2 comboboxes and 2 textboxes. My first combobox contains months in this format january, february, etc, and the other combobox contains numbers from 1 to 31. My first textbox is
Dim BOD as string
BOD = cbomonth.text + "-" + cboday.text + "-" + txtyear.text
There are really two questions here:
I'll let you follow other's instructions for how use
TryParseExtract which is definitely the correct way to go here.
When determining someone's age from their DOB, try using this:
Public Function GetCurrentAge(ByVal dob As Date) As Integer Dim age As Integer age = Today.Year - dob.Year If (dob > Today.AddYears(-age)) Then age -= 1 Return age End Function
It is the vb version of the top answers on Jeff Atwood's very popular question How do I calculate someone's age
I wrote a blogpost about calculating age from dob as well.