working with date

gjoisa

Active Member
Licensed User
Longtime User
Hi , I am developing a program which uses the date according to user's requirement . I cant use here date control because it takes more time to go back up to 50 years if required . So I used 2 combo boxes , 1 for date and 1 for month , and a textbox for year . I have written code like :

a=cbdd.item(cbdd.SelectedIndex)'here cbdd is combobox for date
b=cbmm.item(cbmm.SelectedIndex) ' cbmm is combobox for month
c=txtyyyy.Text
d=b&"/"&a&"/"&c
dob=Dateparse(d)

but when executing the program some times it works perfectly. Some times it works wrongly ; i . e .value of 'dob' becomes "01/01/0001" if i entered the correct value in both combo boxes and textbox . What may be the reason ?:sign0085:
 

maXim

Active Member
Licensed User
Longtime User
Hi gjoisa,

In the attached file is a small example, but I do not know whether resolve your problem...
however this will not be an elegant solution but it works...

Best Regards

Massimo
 

Attachments

  • test.sbp
    1.7 KB · Views: 232
Last edited:

gjoisa

Active Member
Licensed User
Longtime User
Thank you maxim . I will try with your suggessions. Thanks a lot Again.

But dear Erel , can you tell me what may be the problem here ?
 
Top