Page 1 of 1
How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 5:09 am
by swapan
Dear Friends,
I'm stuck with an issue in my Members' Master Form- accepting data against Birthday & DOB.
In the manual form, everybody doesn't wishes to fill the year and just puts in Day & Month's data. And a few supplies the complete Date Of Birth. I've to incorporate both kind of data from a single input and the data should be stored in a single date field of a dbf. And it also should take care during the Modify mode and reports related to birthday & dob/ages.
I would love to have a few suggestions .......... yes I'll use DatePicker control. In the meantime let me also think ...
Regards,
Swapan
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 5:36 am
by Rathinagiri
You can use 'ShowNone' property also at the definition time.
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 6:11 am
by sudip
Hello Swapan,
Rathi is correct, use his tips.
IMOH you can also use 3 textboxes for this - Day, Month, Year. And if a member has provided 3 valid entries then only you can calculate and store DOB in table, otherwise store them in 3 fields or one text field in "yyyymmdd" format.
You may also use one textbox with format "99/99/9999" (But I have to check, whether this format is allowed or not).
For "fast" data-entry I prefer textbox than date picker.
With best regards.
Sudip
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 6:47 am
by Rathinagiri
I agree with you Sudip. I would also prefer text box approach
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 7:41 am
by swapan
Thx Sudip for your inputs. I've also thought in this line ......
sudip wrote:
You may also use one textbox with format "99/99/9999" (But I have to check, whether this format is allowed or not).
Sudip
But then I've to write one function to check if the entered data is a correct valid date or not. In our old Clipper its so easy to take input for a date memory variable with date validation in-built. Can it be same here? Otherwise, I assume lot of things to be done for a proper date input in a textbox.
Regards
Swapan
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 10, 2009 7:48 am
by swapan
rathinagiri wrote:You can use 'ShowNone' property also at the definition time.
Didn't get it!
I've to provide the input control - it will depend upon the user/data whether to bypass the input (no data), partial entry (only day & month) or complete entry (dd / mm /yyyy).
Re: How to accept Birthday Input with DOB as Optional
Posted: Thu Apr 16, 2009 7:30 am
by swapan
At present I've decided to keep only 1 field for DOB in the database, and if the Year is missing in the manual data, get it filled with year 1900 in the system.
To implement a textbox for Date input, I did the following thing:
@ 426 , 740 LABEL lblDOBFormat ;
VALUE '(DD/MM/YYYY)' ;
TOOLTIP "To undislose Year from Date of Birth - supply 1900 in Year field" ;
WIDTH 100
@ 426,625 TEXTBOX txtDt_Of_Birth ;
WIDTH 80 ;
TOOLTIP "To undislose Year from Date of Birth - supply 1900 in Year field" ;
VALUE '01-01-1900' ;
INPUTMASK '99-99-9999' ;
ON GOTFOCUS frmMember.lblDt_Of_Birth.FontBold := .T. ;
ON LOSTFOCUS CheckDOB()
With regards,
Swapan
Re: How to accept Birthday Input with DOB as Optional
Posted: Thu Apr 16, 2009 9:28 am
by Rathinagiri
Why not put DATE option and remove inputmask like below?
@ 426,625 TEXTBOX txtDt_Of_Birth ;
WIDTH 80 ;
TOOLTIP "To undislose Year from Date of Birth - supply 1900 in Year field" ;
VALUE ctod('01-01-1900') ;
date ;
ON GOTFOCUS frmMember.lblDt_Of_Birth.FontBold := .T. ;
ON LOSTFOCUS CheckDOB()
Re: How to accept Birthday Input with DOB as Optional
Posted: Fri Apr 17, 2009 3:42 am
by swapan
rathinagiri wrote:Why not put DATE option and remove inputmask like below?
@ 426,625 TEXTBOX txtDt_Of_Birth ;
WIDTH 80 ;
TOOLTIP "To undislose Year from Date of Birth - supply 1900 in Year field" ;
VALUE ctod('01-01-1900') ;
date ;
ON GOTFOCUS frmMember.lblDt_Of_Birth.FontBold := .T. ;
ON LOSTFOCUS CheckDOB()
Thanks!