|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a way to create a button that when clicked it inserts the current time into a bound field? If so is there a way that once that field is filed the same button would go to another unbound field? I'm trying to learn to write code from reading what the wizard does but there isn't a wizard for this
![]() Last edited by Ryan_Baxter : November 20th, 2003 at 02:06 PM. |
|
#2
|
|||
|
|||
|
It is possible. but it would invlove using a Public Counter and a case statements. I don't know if you want to go to that degree.
S- |
|
#3
|
|||
|
|||
|
If that is what I have to do then if you could give me an example of how to do it I would be greatful. I work for a small ambulance company and I'm working on a dispatch program to track the call info and the time stamping I described in the first post is the only thing I really can't figure out.
|
|
#4
|
|||
|
|||
|
As I though about you need, I thought about a better way to do what you are asking, at least I think it will be better for you.
One each Text box where you need to automatically enter current time. In the Double_click event of those text boxes, enter code that will put the currtne time in the text box. This way you don't have to worry about any kind of loop or anything else. When the user wants the current time to show in the text box, the just double click on it and it shows up., If you need the other code sample let me know. S- |
|
#5
|
|||
|
|||
|
My usual method of handling this is to set the TABstop property of the DateTime control to "NO" and set the value when the form loads or some other event.
Use DateTimeStamp.Value = Now() to get the current date and time and put it into the control. When you say "go to another unbound field" do you mean to set the focus to another control? If so use the SetFocus method for that control at the Click event for the button. Private Sub Command6_Click() ControlName.SetFocus End Sub |
|
#6
|
|||
|
|||
|
What I need is the button when pushed to insert the current time in short time format into an unbound or bound field then when that same button is clicked again for it to insert the time into another unbound or bound field. I hope that I have explained it so that you understand what I mean. I think that it has to be bound fiels because I need the information put into an underlying table. I think that it might require If Then statement but I have no idea how to write it.
|
|
#7
|
|||
|
|||
|
Can post a copy of the form you are planning to use I will give you an example.
S- |
|
#8
|
|||
|
|||
|
Yeah Give me a few I'm still in the design stage and I'll have to build a demo of the form
|
|
#9
|
|||
|
|||
|
Here is an example of the form it is the one named Demo
|
|
#10
|
|||
|
|||
|
Here you go.
I would still only put the code in the double click action of each of the text boxes (included it also for you to look at) there are potential reasons for each, but I will let you decide what you like best) Advice: I know you where rushed to put the demo together and Access can handle spaces in the names of textboxes and table, adn queries, but Don't use spaces. It makes it harder to code later on. It is also good to prefix the object with someting that identfies what the object is that is being used S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Time |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|