How to accept Birthday Input with DOB as Optional

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

How to accept Birthday Input with DOB as Optional

Post 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 ... :D


Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post by Rathinagiri »

You can use 'ShowNone' property also at the definition time.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: How to accept Birthday Input with DOB as Optional

Post 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
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post by Rathinagiri »

I agree with you Sudip. I would also prefer text box approach
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post 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
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post 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).
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post 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
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post 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()
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How to accept Birthday Input with DOB as Optional

Post 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!
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
Post Reply