Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date and Time

Status
Not open for further replies.

jdwm2310

Technical User
Jul 26, 2001
396
US
Hi,

I have a tab control with 2 tabs: (1) Solved and (2) Routed. In each tab there are two text box (1) Solved by or Routed to and (2) Date Solved/ Date Routed. the default value is set to =Now(). But i want the date to be the date and time the solved by or routed to fields have be entered.
I would appreicate all your help, thanks
 
So, you want the controls to show the date the whateveritis is solved/routed or the date that data was entered into some other field? Can you advise as you seem to have two requirements here. Have fun! :eek:)

Alex Middleton
 
AlexMidd,

ok i have to a tab control in each tab there are two text box. (1) solved by (2) date solved. In the second tab the fields are (1) routed by and (2) date routed.

I want the dates:date solved and date routed to be entered when the user enters their name into the solved by field or the routed by field.

For example
Solved by: James Monroe Date Solved: Jan 14, 2002 11:19AM
(so when James Monroe enters his name then the most current date should appear)

Please Help!!!!!!!!!!!!!!
 
Still don't understand. Do you want the current date to be entered automatically, or the user to enter the date that it was solved/routed? If the latetr, why don't they just enter the date/time in the date solved/routed box?

Sorry if I am seeming dim on this, just trying to help. Have fun! :eek:)

Alex Middleton
 
AlexMidd,

Don't worry about it.... i want the system to automatically enter the date,when the person enters their name. so the date is going to be a fixed field, no one can edit it...

 
The easiest way is to set the default value in the design view of your tables that contain your date solved and date routed fields. This is in the general area of the field properties. You can use the expression builder to get the exact entry that you want. When others are entering data they do not even need to see this, it will automatically be entered. Then turn off edits when displaying these dates
 
From what I can see, the Now() function is appropriate here. This will enter the date and time automatically into the date box, and the date and time will be that at that time. You could add code to the AfterUpdate event of the text box that adds the current date and time to the date box in that event,

e.g.

Private Sub Text1_AfterUpdate
Text2 = now()
End Sub

where Text1 is the text box and Text2 is the date box. As evercall says, you could hide the date boxes at this point as they do not have to see this happening - it can be in the background. Have fun! :eek:)

Alex Middleton
 
AlexMidd

I definitely agree with you regarding the Now().

I entered this code in the Afterupdate
Private Sub Text62_AfterUpdate()
Date_Closed.Visible = Now()
End Sub

it works fine, i made the date text box invisible but now when i save the record and create a new record the date text box becomes visible...any suggestions...thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top