UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> On Form Number Entry For Dob Formatted Field, Access 2003    
 
   
ebwhittaker
post Dec 5 2017, 08:24 AM
Post#1



Posts: 1,155
Joined: 9-January 08
From: Arcadia, Florida


Form now contains only a single field formatted for DOB date entry - mm/dd/yy
I'd like to add fields labeled 1 through 0 that when clicked would add this number to the dob field
i can't seem to get it to add each number clicked to the previous one in sequence
Any suggestions would be appreciated
Thanks
Ed
Go to the top of the page
 
Jeff B.
post Dec 5 2017, 08:30 AM
Post#2


UtterAccess VIP
Posts: 9,884
Joined: 30-April 10
From: Pacific NorthWet


You're describing "how" (add one to previously entered DOB) -- "why"? What will having the day after a date-of-birth then allow you to do?

--------------------
Regards

Jeff Boyce
Microsoft Access MVP (2002-2015)

Mention of hardware or software is, in no way, an endorsement thereof. The FTC of the USA made this disclaimer necessary/possible.
Go to the top of the page
 
GroverParkGeorge
post Dec 5 2017, 08:49 AM
Post#3


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


When you say you want to "add each number" to the DOB, are you saying that the result would be a series of Dates?


--------------------
Go to the top of the page
 
theDBguy
post Dec 5 2017, 11:08 AM
Post#4


Access Wiki and Forums Moderator
Posts: 71,230
Joined: 19-June 07
From: SunnySandyEggo


Hi Ed,

Are you trying to create an on-screen numeric keyboard?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Microsoft Access MVP | Access Website | Access Blog | Email
Go to the top of the page
 
ebwhittaker
post Dec 5 2017, 12:39 PM
Post#5



Posts: 1,155
Joined: 9-January 08
From: Arcadia, Florida


Sorry guess i was not specifuc enough
I have a form that shows a field that is for the date of birth .. this date is entered and the checks against a database and if found opens another form showing the name, etc. of all matches.
the scenerio is a customer comes in and needs to get an armband. They are looked up by date of birth which is a lot less cumbersome than name, etc. And faster.
If they are not found they fill out and sign an insurance waiver and it is, after the fact, put into the dstabase so the next time they come in the will come up and not need to fill out and sign another waiver

what i need is number buttons, 1 through 0, on the same form as the DOB field so the user can click (tap on tablet) on the numbers and have them entered into the dob field

Using on the tablet the onscreen keyboard either covers up the field or moves it up off screen so a 'keypad' on the form itself would ideal
Go to the top of the page
 
GroverParkGeorge
post Dec 5 2017, 12:55 PM
Post#6


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


Ah, I see. You want to build a string using these controls to generate a valid date.

That's one way. How about this instead.

Three list or combo boxes. One has 12 records for month. One has 31 records for days. One has a variable number of records for potential birth years (your application will determine what's reasonable. For example, will this be limited to children, to adults over 1, or to anyone from 0 up to 120).

Building the birthdate from those three using the Click Event of a command button next to them.

Private Sub BuildDOB_Click()

Dim dtDob as date

With Me

dtDob = DateSerial( .cboSelectYear, .cboSelectMonth, .cboSelectDay)

End WIth
End Sub

--------------------
Go to the top of the page
 
GroverParkGeorge
post Dec 5 2017, 01:02 PM
Post#7


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


You can do something similar, of course, with 10 individual text box controls, by building strings for each date part from their respective text boxes, e.g. DtBirthYear = .txtYearDigitOne & .txtYearDigitTwo & .txtYearDigitThree & .txtYearDigitFour

and so on.

--------------------
Go to the top of the page
 
ebwhittaker
post Dec 5 2017, 01:19 PM
Post#8



Posts: 1,155
Joined: 9-January 08
From: Arcadia, Florida


Although both are valid options the time to enter would negate the purpose I think
Could just concantenate as a string 6 number 'clicks' .. like "0" + "5" + "1" + "0" + "4" + "4"
Ten buttons on the form for each number
So the string would be 051044
Can i then use this to put into the DOB field that is formatted as mmddyy
Thanks
Ed
This post has been edited by ebwhittaker: Dec 5 2017, 01:21 PM
Go to the top of the page
 
GroverParkGeorge
post Dec 5 2017, 01:44 PM
Post#9


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


Sure, once you have that string of 6 digits, you can parse it for elements of a valid date:

strDigits ="051044"

dtDOB = DateSerial(Right(strDigits,2),Mid(strDigits,3,2),Left(strDigits,2))

--------------------
Go to the top of the page
 
Jeff B.
post Dec 5 2017, 02:40 PM
Post#10


UtterAccess VIP
Posts: 9,884
Joined: 30-April 10
From: Pacific NorthWet


What happens if the user doesn't know the 'right' way to enter dates? ... or, like me, has BFF syndrome (big fat finger)?

Would it work to have the user enter an actual date? (How you store the date data doesn't have to be the same as it is entered...)

--------------------
Regards

Jeff Boyce
Microsoft Access MVP (2002-2015)

Mention of hardware or software is, in no way, an endorsement thereof. The FTC of the USA made this disclaimer necessary/possible.
Go to the top of the page
 
ebwhittaker
post Dec 5 2017, 04:01 PM
Post#11



Posts: 1,155
Joined: 9-January 08
From: Arcadia, Florida


Ok i set the form to include 10 buttons 1 thru 0
On the onclick it just adds that number to any existing and displays it in the DOB field ..
This seems to work and displays the date .. now next step is to use your format to create an actual date for the query. Noticed you seem to have the format set to put the year first rather than last .. it is stored in the main database as mmddyy so i think i can just reverse the two left and right strings.
Thanks
Ed
Go to the top of the page
 
GroverParkGeorge
post Dec 5 2017, 04:45 PM
Post#12


UA Admin
Posts: 31,234
Joined: 20-June 02
From: Newcastle, WA


I think you should look into how the DateSerial() function works before changing anything. thumbup.gif

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    15th December 2017 - 08:36 PM