Want to have an event happen when ctrl+r is pressed

Ksel

New member
Local time
Today, 09:45
Joined
Jun 12, 2014
Messages
8
Hey all!

When I press ctrl+r I want to copy a couple values from the previous record (on a continuous form) into the current record. I figure you would use the KeyPress event for this, but I want the event to occur when ctrl+r is pressed while Me.TechName has the focus. I'm just a little confused about how to work the variables, etc in this KeyPress event.

For a bit more detail, the event is this: I want Me.TimeIn and Me.TimeOut to be populated with the same values as TimeIn and TimeOut in the record BEFORE in this continuous form. I'm also looking into how I would code that procedure, so any guidance on that is appreciated as well!

Thanks much,
Kevin
 
for the timein and timeout controls, why not just put the following in the afterupdate event?

timein.default=timein

and

timeout.default=timeout
 
Thanks for the input CJ London. When I did that code the next record's TimeIn and TimeOut populated with #Name. Any thoughts on that? Anyways, My thinking is that the user will get confused sometimes when if there is a default value (rather than manually copying the previous record). That's the only reason why I prefer to have them do a keystroke to trigger the event.

For reference, I attached a picture of what I'm going for. You can see that I'm about to enter Tom's time, but I want Tom's time to be the same as David's because they're always together on jobs.

Kevin

(cool quote needed)
 

Attachments

  • Time Entry Form.png
    Time Entry Form.png
    36.8 KB · Views: 132
should be defaultvalue rather than default - my bad

probably because this is a time value so code should be

timein.defaultvalue="#" & timein & "#"

you know that you can use ctrl-' to copy the value from the previous record?
 

Users who are viewing this thread

Back
Top Bottom