I need your help

S

Salam80

My dear friends: I am an MS access beginner. I developed a database an
i created a date field. To fill that date frield in the form, instea
of a single textbox, I created three drop-down lists for dd, mm an
yyyy. I wanted that date field to take its value from the three lists
I used the DateValue() function. It works but only inside the form. I
converts the date-like string into date value, but that only on th
form. When I enter records, I go back to the table and I dont see th
dates.
Please tell me how to use the three drop-down (combo) lists to obtain
date value that can be stored in the db table.
regard
 
F

fredg

My dear friends: I am an MS access beginner. I developed a database and
i created a date field. To fill that date frield in the form, instead
of a single textbox, I created three drop-down lists for dd, mm and
yyyy. I wanted that date field to take its value from the three lists.
I used the DateValue() function. It works but only inside the form. It
converts the date-like string into date value, but that only on the
form. When I enter records, I go back to the table and I dont see the
dates.
Please tell me how to use the three drop-down (combo) lists to obtain a
date value that can be stored in the db table.
regards

Is there a reason you have concocted such a user unfriendly scheme?

To create and save a valid date field, using the three 3 controls,
code the AfterUpdate event of the last one to be entered (let's say
it's the [YearControl]:
[MyDateField] = DateSerial([YearControl],[MonthControl],[DayControl])

Note: the 3 controls should not be bound to a field in the table. The
[MyDateField] should be bound to the table field.
 
C

Craig Hornish

Inline

--
Craig Hornish

Visit weekly Access conferences
Tuesday, 11:00am-12:30pm (Eastern US)
Thursday, 3:30pm- 5:00pm (Eastern US)

http://community.compuserve.com/n/pfx/forum.aspx?webtag=ws-msdevapps

"Think outside the box, because anything is possible."
"How long it will take or whether it requires divine intervention is another
issue"
fredg said:
Is there a reason you have concocted such a user unfriendly scheme?

Fredg - Do you think he knows about the proper way - probably not - give an
example of what is proper too - even though you answered the quetion for
this person "beginner" he probably doesn't know.

So

Just use a text box and format it for date, then the user can enter
1/1007 - the second / already being supplied
The field in the table can be Date/Time - an in the input mask of the text
box on the form you can put your formating - there are opptions but one is
##/##/## -

- or better yet give them access to a calendar also.

I use an active X calendar Control on a popup form that then puts the date
back into the field - this would take longer to explain but will give you
another option latter - it still uses the textbox for the date.


To create and save a valid date field, using the three 3 controls,
code the AfterUpdate event of the last one to be entered (let's say
it's the [YearControl]:
[MyDateField] = DateSerial([YearControl],[MonthControl],[DayControl])

Note: the 3 controls should not be bound to a field in the table. The
[MyDateField] should be bound to the table field.
 
Top