Save on Second form

  • Thread starter AccessUser777 via AccessMonster.com
  • Start date
A

AccessUser777 via AccessMonster.com

Hello all,
I have two forms; one of which is behind the scenes. I'm trying to capture
time stamps on how long it takes an employee to complete a task. Form1 has
all the task info (taskid, issue, actions etc). Form2 has fields empID,
taskid,starttime, endtime. Form2 will ask for the empID then hide and open
Form1. Once the field for taskID is entered on Form1 I want copy that value
and populate it on Form2 and also record the starttime with now() function on
Form2. When the employee clicks on Save on Form1, I want to record the
endtime now() on Form2.

I've tried several ways to copy the taskid from Form1 to Form2 with codes
from this site however, I couldn't get it to work; so I ended up creating a
macros to do that.

On Form2 I have the following code

ON ENTER event for task ID
me.starttime.value=now()

But this isn't working either

In a nutshell I looking for code for the following
1) copy a value from form1 to form2
2) what event should I use when the value is populated on Form2 to start
recording time
3) code to record end time on Form2 when the user clicks on save on Form1
 
J

Jeff Boyce

I may be missing something here...

If you want a control in form2 to get a value, you'd refer to it (in you
code behind ...) with something like:

Forms!Form2!StartTime = Now()

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

AccessUser777 via AccessMonster.com

Hi Jeff,
Many thanks for your prompt response!!!

the value that I want to populate on form2 is taskID from form1. I've trided
the code:
forms!Form2!taskid=me.taskid---(both forms have the same field name) but it
doesn't transfer that value....maybe I'm putting it in the wrong place???

as for the start time; I want to record the time once the field taskID on
form2 is populated.

Also any idea on how i can record the end time on form2 when the user clicks
"save" on form1?


Again many thanks for any assistance that is provided!!!!

Jeff said:
I may be missing something here...

If you want a control in form2 to get a value, you'd refer to it (in you
code behind ...) with something like:

Forms!Form2!StartTime = Now()

Regards

Jeff Boyce
Microsoft Office/Access MVP
Hello all,
I have two forms; one of which is behind the scenes. I'm trying to
[quoted text clipped - 28 lines]
recording time
3) code to record end time on Form2 when the user clicks on save on Form1
 
J

Jeff Boyce

You've described "how" you are trying to accomplish something (2 forms,
timing and taskID, etc.).

But there may be other ways to get done what you need done (and what that is
isn't clear yet).

Please describe the business need/issue/problem you are trying to solve, and
the data structure (not the form structure) you are starting with (it all
starts with the data).

Regards

Jeff Boyce
Microsoft Office/Access MVP


AccessUser777 via AccessMonster.com said:
Hi Jeff,
Many thanks for your prompt response!!!

the value that I want to populate on form2 is taskID from form1. I've
trided
the code:
forms!Form2!taskid=me.taskid---(both forms have the same field name) but
it
doesn't transfer that value....maybe I'm putting it in the wrong place???

as for the start time; I want to record the time once the field taskID on
form2 is populated.

Also any idea on how i can record the end time on form2 when the user
clicks
"save" on form1?


Again many thanks for any assistance that is provided!!!!

Jeff said:
I may be missing something here...

If you want a control in form2 to get a value, you'd refer to it (in you
code behind ...) with something like:

Forms!Form2!StartTime = Now()

Regards

Jeff Boyce
Microsoft Office/Access MVP
Hello all,
I have two forms; one of which is behind the scenes. I'm trying to
[quoted text clipped - 28 lines]
recording time
3) code to record end time on Form2 when the user clicks on save on
Form1
 
E

ErezM

hello user
why dont you use the 1 open and visible form to do all the work, keep the
visible fields for the use of the user, and add hidden fields (such as
startTime, EndTime) to that same form, then you wont have to wait for
anything (i mean you also save the start and end times in the same record as
the data itself)
if you do that, you can identify start time by using the dirty event of the
form or the change event of the taskID control (set StartTime=Now())
and the EndTime=Now() is to be set on the AfterUpdate and/or AfterInsert
event/s for the form

good luck.

Jeff said:
You've described "how" you are trying to accomplish something (2 forms,
timing and taskID, etc.).

But there may be other ways to get done what you need done (and what that is
isn't clear yet).

Please describe the business need/issue/problem you are trying to solve, and
the data structure (not the form structure) you are starting with (it all
starts with the data).

Regards

Jeff Boyce
Microsoft Office/Access MVP
Hi Jeff,
Many thanks for your prompt response!!!
[quoted text clipped - 33 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top