Prompted to Default Date or User Option to Change Date

  • Thread starter Thread starter Emine
  • Start date Start date
E

Emine

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!
 
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.
 
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!!
 
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.
 
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!
 
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.
 
Back
Top