Timestamp and choose DATE and Time in form's TextBox

johnseito

Registered User.
Local time
Today, 08:04
Joined
Feb 27, 2013
Messages
89
Hi,

I've created a form with a number of fields.
One is a combo box, label as "Seller" and
the second one is a text box, label as "Start_Time"
and the third one is a text box, label as "End_time".

I wanted to have a time stamp on the "Start_Time" field when the user selects
a seller in the combo box.

and for The "End_Time" the user are able to choose with a calender pop up of the date and time.

How can I do this, please provide some guidance with some example if you can since I am just beginning to get familiar with Access and I have some ways to go.

Thank you
 
ok... this is how this would be done, i'm going to show you how to do it for one and then you can work it out from there..

Private Sub combobox_AfterUpdate()
Me.Start_Time = Now()
End Sub

what this does, is when someone updates Combobox it'll put the time into Start_Time, have a look at the help file, as you can use Now(), Date() and be even more complex..
 
Ok, thanks, I got the start time to work. When a user selects the seller combo box, the start time automatically appear with the date and time.

How about the end time, I have a text box that I would like to have the user click on it
and choose a date and time, hopefully with a calender pop out.
 
I have both 2007 and 2010 installed but I use 2010.

There is a difference with using both of these to accomplish this? Thx
 
ok, create a text box and in the format for it, make it a short date, that way users can pick the date for it..
 
Both of this Access version have a built in calendar from where you can choose a date.
Use it !
 
Ok, thanks, have any idea or share any clues on how to do that on both of them?
 
Oh. Sorry that I don't reply again, but I think that is obviously for you after I say about the built in calendar:
For the second box (where the user must input the End Time) go to Property Sheet and set the property ShowDatePicker to Alwais.
After that, when you run the form, when you enter in this textbox, a small icon for a calendar appear. Click on this icon and the calendar is popup. As soon as you select a date, this date is inserted in the text box.
Let me know if this is what you are looking for or you need other things.
 
Hi, thanks.

I follow your steps,

" go to Property Sheet and set the property ShowDatePicker to Alwais."

In property sheet, show date picker, I only see For dates and never. Those are the two choices.

I was looking for a calendar pop so user can choose the date and also a time for that date period. From what you are telling me, it seems the user can only choose the date and not the time, right?
 
Yep. My mistake.
Go again to the Property Sheat, Format tab, and format your text box as Date. Choose the appropriate format for your needs. (of course the Show Date Picker should be set For Dates).
Sorry for wrong information. Is because the advanced age :) .
 
this is what I did from the instructions that you have given:

Open up the form in design view, go to property sheet, click on the end_time text box, go to format tab, format your text box as date (how to do this?)

And would there be a time, they are allow to choose for that date, if not how can I do it where they can choose a date and a time for that date? Thanks.
 
Ok, I see what you did, the difference with yours and my text box that allow you to do that and not me is because my text box in not unbound.

It the data tab, it has end_time the form's record source is AUCTION. The reason I did this is because I want when the user choose a date and time, it will then input it to the end_time field in the table Auction.

With how you do it, when a user choose a date and time, it doesn't input it to the table Auction's End_Time field.

How can I do this?

I attached a pic to illustrate, how I did is different than how you did yours.

The top of the pic you could see I choose a form and the record source I choose Auction table, and from the bottom pic you could see that from the format, I can't choose anything.
 

Attachments

  • pix.png
    pix.png
    37.3 KB · Views: 248
Set the End_Time field's data type as Date/Time (at table level)
 
Ok, I see what you did, that work.

But the time didn't get insert into the table, the date did.

Why is that ?
 
Ok, I see what you did, that work.

But the time didn't get insert into the table, the date did.

Why is that ?

what I meant to say is that the start time in the table field has the date and time, but not the end_time, the end time is the selection of the date from the calendar, on the end date table field, it only has the date and not the time.

do you know how can the time be there?
 
I am doing what you are doing but I can't select it.
 

Attachments

  • 2.png
    2.png
    29 KB · Views: 191

Users who are viewing this thread

Back
Top Bottom