Time

M

Michael Mishler

This should be simple:

I simply want to know the function to paste time into a text box:

I have:

txtTime.text = Time

I get: "Invalid use of null"


How can I paste the time in a text box?

Thanks!
 
J

Jim Kennedy

Instead of Time, try using Now()...and then set the format
property of the text box to your preferred time format.
 
C

Cameron Sutherland

lose the .text value. It should be:
txtTime = Time

the .text only works if the text box currently has the
focus so why make it harder on yourself by specifiyng it
when omitting it works fine.

-Cameron Sutherland
 
P

PC Datasheet

If the textbox is unbound, put this expression in its control source property:

= Time()

If the textbox is bound, the bound field needs to be DateTime data type. Put
this code in an appropriate event:

Me!NameOfTextbox = Time()


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
M

Mark Burns

Michael,

Being a VB developer type myself, I prefer the explicit object syntax:

me.txtTime.value = time() 'control format set to appropriate time format
or
me.txtTime.value = now() 'control format set to appropriate time format

yeah, it's a little more verbose, but if I come back to an access
form coded like this after six months of doing VB/C#/VB.Net
etc.,. coding work and come back to this I instantly know what
is happening by reading the code without having to try and
remember what the dang default property name for a text box
control in Access is (.value).

- Mark

: This should be simple:
:
: I simply want to know the function to paste time into a text box:
:
: I have:
:
: txtTime.text = Time
:
: I get: "Invalid use of null"
:
:
: How can I paste the time in a text box?
:
: Thanks!
:
:
 

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

Top