time / date pane query (1 Viewer)

NickNeville

Registered User.
Local time
Today, 21:41
Joined
May 17, 2009
Messages
119
Good morning all.
Could anyone help with the following please.
I am working in access 2007 and on my form I am entering in a date and time, in two separate control boxes. When I enter the control a small Date pane appears where I can then pick my date. When I next go to my Time control the same date pane appears but only offers me a date again. My question is therefore can I get this Date pane to change to some sort of a time pane so that I may pick a time to store.?
I have uploaded a snip pic to show.
Thanks for you help
Nick
 

Attachments

  • Time capture.JPG
    Time capture.JPG
    23.5 KB · Views: 92

apr pillai

AWF VIP
Local time
Tomorrow, 02:11
Joined
Jan 20, 2005
Messages
735
I don't think you need that. If you need some control like that then you need 86400 items in the list, if 1 second interval is used. 17280 items in the list with 5 seconds interval, 8640 items with 10 seconds intervals in 24 Hr. period. You can imagine selecting a time value from within this list.

But, you can record the current time with the click of a Command Button. Create a small Command Button near the Time Field and change the Name property value to cmdTime. I have given the target field name as dbltime. Copy and paste the following VBA Code into the Module of your Form.

Code:
Private Sub cmdTime_Click()
  Me![[B]dbltime[/B]] = Format(Now() - Int(Now()), "hh:nn:ss")
End Sub

Replace the name dbltime with your own time field name.
 

NickNeville

Registered User.
Local time
Today, 21:41
Joined
May 17, 2009
Messages
119
Many thanks your reply
Yes it seems along way round, I think I'll try your idea and code as it sounds like a better way.
thanks again
Nick
 

missinglinq

AWF VIP
Local time
Today, 16:41
Joined
Jun 20, 2003
Messages
6,420
I'd use that code, but put it in the DoubleClick event of the time field Control. And the Calendar that is currently popping up, when you enter that Textbox, can be suppressed by setting its Show Date Picker Property to No.

Linq ;0)>
 

NickNeville

Registered User.
Local time
Today, 21:41
Joined
May 17, 2009
Messages
119
Hi there linq
could you advise me on how to suppress that small calendar within the text box please ?

Nick
 

missinglinq

AWF VIP
Local time
Today, 16:41
Joined
Jun 20, 2003
Messages
6,420
Per Allen Browne's site, in Form Design View, select the Textbox, go into Properties and find the Show Date Picker Property and set it to No.

Can't tell you which tab it's on in Properties, as I don't run 2007/2010 as of yet. I'd click on the All tab to search for it.

Linq ;0)>
 

apr pillai

AWF VIP
Local time
Tomorrow, 02:11
Joined
Jan 20, 2005
Messages
735
Select the Control and press F4 to display the Property Sheet.
 

Users who are viewing this thread

Top Bottom