inputting a date into a text box

N

Nick T

Hi,
I need to put a date into a text box on a form i have.
The date format i want is dd/mm/yy

I need this info put into the text box by using only a number key pad i have
set up on the form using cmd buttons. The control source for my date text
box is set to 'date/time' format in the table and so is the format of the
text box in the properties list.
However, when i click one of my numbers on my forms key pad, it throws up an
error, and says the value i have entered isnt valid(?) i suppose, because at
that time i have only entered one digit as apposed to somthing in a date
format.

Is there any simple way for me to format my text box so that when i type
into the text box e.g. 140309 it automatically appears as 14/03/09??

Any help appreciated.
Many thanks
 
K

KARL DEWEY

UNTESTED UNTESTED
Try an unbound textbox with transparent background over the bound textbox.
Have macro or event to parse the string and convert to date, set value of
bound text box, and clear the unbound text box.

DateSerial("20"&Right([xact_dat],2),Left([xact_dat],2),Right(Left([xact_dat],4),2))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Enter Date Format 9
Text to date format? 0
Can't format a text box 5
How to show qry "criteria" on a report ? 10
Dlookup 7
Date Formatting 1
Access 2 Digit year in Access Text Box 3
Query Results in a Text Box 3

Top