date and time in unbound form

  • Thread starter Thread starter R. Choate
  • Start date Start date
R

R. Choate

I'm trying to configure an unbound date textbox and an unbound time textbox on an unbound userform. I want the textboxes to show by
default, the current date in "mm/dd/yy" format, and the current time in "short time". However, I want my user to be able to override
the default and enter some other date or time, so long as they enter it in the correct mask format. So far, I'm only getting it to
either give me the default values I want without allowing me to change them, or it won't give me any values but it will allow me to
enter one. I could use a little guidance on setting the properties for these 2 boxes. Should I set the initial values as part of the
form's open event, or do something with the txtbox properties directly without code?

Thx in advance
 
what methods of setting the default values have you tried so far?


R. Choate said:
I'm trying to configure an unbound date textbox and an unbound time
textbox on an unbound userform. I want the textboxes to show by
default, the current date in "mm/dd/yy" format, and the current time in
"short time". However, I want my user to be able to override
the default and enter some other date or time, so long as they enter it in
the correct mask format. So far, I'm only getting it to
either give me the default values I want without allowing me to change
them, or it won't give me any values but it will allow me to
enter one. I could use a little guidance on setting the properties for
these 2 boxes. Should I set the initial values as part of the
 
I appreciate your response, but really it doesn't much matter what I have already tried. I know that what I have already tried
doesn't work. Now I need to know what will work. I think this is pretty basic and I know I've done it before, but I cannot remember
how it is supposed to be done. If somebody can help, I will appreciate it.
--
RMC,CPA


what methods of setting the default values have you tried so far?


R. Choate said:
I'm trying to configure an unbound date textbox and an unbound time
textbox on an unbound userform. I want the textboxes to show by
default, the current date in "mm/dd/yy" format, and the current time in
"short time". However, I want my user to be able to override
the default and enter some other date or time, so long as they enter it in
the correct mask format. So far, I'm only getting it to
either give me the default values I want without allowing me to change
them, or it won't give me any values but it will allow me to
enter one. I could use a little guidance on setting the properties for
these 2 boxes. Should I set the initial values as part of the
 
Setting the Default property of the text boxes to =Date() and =Time()
respectively should be all you need to do.

If that doesn't work, let us know what's happening instead: do you get an
error (if so, what's the error), do you get an incorrect date and/or time
(if so, is there any pattern to the discrepency) or does something else
happen?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


R. Choate said:
I appreciate your response, but really it doesn't much matter what I have
already tried. I know that what I have already tried
doesn't work. Now I need to know what will work. I think this is pretty
basic and I know I've done it before, but I cannot remember
 
That worked. I knew it was simple; I was just drawing a blank.

Thanks, Doug !
--
RMC,CPA


Setting the Default property of the text boxes to =Date() and =Time()
respectively should be all you need to do.

If that doesn't work, let us know what's happening instead: do you get an
error (if so, what's the error), do you get an incorrect date and/or time
(if so, is there any pattern to the discrepency) or does something else
happen?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


R. Choate said:
I appreciate your response, but really it doesn't much matter what I have
already tried. I know that what I have already tried
doesn't work. Now I need to know what will work. I think this is pretty
basic and I know I've done it before, but I cannot remember
 
Back
Top