Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Prompted to Default Date or User Option to Change Date

Geek News

Prompted to Default Date or User Option to Change Date
Emine 12/4/2008 2:44:07 PM
My form opens with current date. I want it so that user has the option of
using either default date or changing the date as necessary. Can someone
please give me the VB code on this? I've tried looking it up, but have not
found anything. Thank you everyone!
Re: Prompted to Default Date or User Option to Change Date
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/4/2008 5:45:12 PM
On Thu, 4 Dec 2008 06:44:07 -0800, Emine <Emine[ at ]discussions.microsoft.com>
wrote:

[Quoted Text]
>My form opens with current date. I want it so that user has the option of
>using either default date or changing the date as necessary. Can someone
>please give me the VB code on this? I've tried looking it up, but have not
>found anything. Thank you everyone!

If you'ld please describe where this date is found, and what you mean by
"opens with", someone might be able to help.
--

John W. Vinson [MVP]
Re: Prompted to Default Date or User Option to Change Date
Emine 12/4/2008 6:12:09 PM
I'm sorry I wasn't clear enough. I have a student form so that when it opens
there is a date field that defaults to today's day each time its opened. But
I want the user to be able to change the the date if they need to change it
or leave the default date as is. Hope this makes sense. Thank you so much!!

"John W. Vinson" wrote:

[Quoted Text]
> On Thu, 4 Dec 2008 06:44:07 -0800, Emine <Emine[ at ]discussions.microsoft.com>
> wrote:
>
> >My form opens with current date. I want it so that user has the option of
> >using either default date or changing the date as necessary. Can someone
> >please give me the VB code on this? I've tried looking it up, but have not
> >found anything. Thank you everyone!
>
> If you'ld please describe where this date is found, and what you mean by
> "opens with", someone might be able to help.
> --
>
> John W. Vinson [MVP]
>
Re: Prompted to Default Date or User Option to Change Date
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/4/2008 8:04:10 PM
On Thu, 4 Dec 2008 10:12:09 -0800, Emine <Emine[ at ]discussions.microsoft.com>
wrote:

[Quoted Text]
>I'm sorry I wasn't clear enough. I have a student form so that when it opens
>there is a date field that defaults to today's day each time its opened. But
>I want the user to be able to change the the date if they need to change it
>or leave the default date as is. Hope this makes sense. Thank you so much!!

If you're using the DefaultValue property of the textbox to set the default
value, that should be no problem.

Are you perhaps using

=Date()

as the Control Source property instead? Is the date field stored in your table
(it will need to be)?

Bear in mind that a Form *is just a window*. You can't store a date in a Form
any more than I can store the Owyhee Mountains in my office window.
--

John W. Vinson [MVP]
Re: Prompted to Default Date or User Option to Change Date
Emine 12/4/2008 10:06:04 PM
Yes you are right. I will need to add that, but how do I do the VB code so
that users can change the date if they want to change it? Or do I need a VB
code once I add that date field into the table? Will that solve the problem?
Thank you so much!

"John W. Vinson" wrote:

[Quoted Text]
> On Thu, 4 Dec 2008 10:12:09 -0800, Emine <Emine[ at ]discussions.microsoft.com>
> wrote:
>
> >I'm sorry I wasn't clear enough. I have a student form so that when it opens
> >there is a date field that defaults to today's day each time its opened. But
> >I want the user to be able to change the the date if they need to change it
> >or leave the default date as is. Hope this makes sense. Thank you so much!!
>
> If you're using the DefaultValue property of the textbox to set the default
> value, that should be no problem.
>
> Are you perhaps using
>
> =Date()
>
> as the Control Source property instead? Is the date field stored in your table
> (it will need to be)?
>
> Bear in mind that a Form *is just a window*. You can't store a date in a Form
> any more than I can store the Owyhee Mountains in my office window.
> --
>
> John W. Vinson [MVP]
>
Re: Prompted to Default Date or User Option to Change Date
John W. Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 12/5/2008 12:42:29 AM
On Thu, 4 Dec 2008 14:06:04 -0800, Emine <Emine[ at ]discussions.microsoft.com>
wrote:

[Quoted Text]
>Yes you are right. I will need to add that, but how do I do the VB code so
>that users can change the date if they want to change it? Or do I need a VB
>code once I add that date field into the table? Will that solve the problem?

If you add the date field into the table, and set its DefaultValue property to
=Date() (or, alternatively, use a Textbox bound to the date field in the table
and set the Textbox's Default Value property to =Date()), then you're done.
You will need no code at all.
--

John W. Vinson [MVP]
Re: Prompted to Default Date or User Option to Change Date
Emine 12/5/2008 1:22:00 AM
John, thank ever so much! Have a wonderful evening!!

"John W. Vinson" wrote:

[Quoted Text]
> On Thu, 4 Dec 2008 14:06:04 -0800, Emine <Emine[ at ]discussions.microsoft.com>
> wrote:
>
> >Yes you are right. I will need to add that, but how do I do the VB code so
> >that users can change the date if they want to change it? Or do I need a VB
> >code once I add that date field into the table? Will that solve the problem?
>
> If you add the date field into the table, and set its DefaultValue property to
> =Date() (or, alternatively, use a Textbox bound to the date field in the table
> and set the Textbox's Default Value property to =Date()), then you're done.
> You will need no code at all.
> --
>
> John W. Vinson [MVP]
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net