How to repeat data from one field to another.

T

TD

I tried a post in another newsgroup, but have not received any replies, so I
would like to try posting the same question here please.

I have a form that I enter employee's time into. The first field is a combo
box where I choose the name of the employee from a table. Then the second
field I tab to is the date. What I want to be able to do is on the second
line of the data entry screen I would like for the same employee name to
automatically be filled in as was on the first line (until I override it
with another employees name) and then when I tab to the second field on the
second line it automatically puts the next days date in for me. In other
words, I want to enter Employee "A" time for the whole week - Mon, Tue,
Wed....etc. then go to Employee "B"..... with first line for Employee "A"
having Mondays date, second line having Tuesdays date....etc.


Any help would be very much appreciated.

TD
 
J

Jonathan

-----Original Message-----
I tried a post in another newsgroup, but have not received any replies, so I
would like to try posting the same question here please.

I have a form that I enter employee's time into. The first field is a combo
box where I choose the name of the employee from a table. Then the second
field I tab to is the date. What I want to be able to do is on the second
line of the data entry screen I would like for the same employee name to
automatically be filled in as was on the first line (until I override it
with another employees name) and then when I tab to the second field on the
second line it automatically puts the next days date in for me. In other
words, I want to enter Employee "A" time for the whole week - Mon, Tue,
Wed....etc. then go to Employee "B"..... with first line for Employee "A"
having Mondays date, second line having Tuesdays date....etc.


Any help would be very much appreciated.

TD
Hi TD,
the key strokes to copy the values from the previous
record, same field is control ' (apostrophy)

look up online help for docmd.sendkeys "^'"

use the on enter event - first check for null value in
field.

luck
Jonathan
 
P

PC Datasheet

Before you struggle too much longer, your tables are not set up correctly!

You need:

TblEmployee
EmployeeID
FirstName
LastName
etc

TblEmployeeTime
EmployeeTimeID
EmployeeID
TimeDate
HoursWorked

You then need to create a query based on tblEmployee settinf sort ascending on
the LastName field. Next you need to create a form/subform where the main form
is based on the previous query and the subform is based on TblEmployeeTime. Once
you have this built then you work out how to automatically display the TimeDate
so you can enter the HoursWorked. A suggestion to start wit is to create an
unbound control in the main form where you can enter the beginning of work week
date.
 
T

TD

Thanks Jonathan. However, I'm a real new beginner and I don't quite
understand how to check for a null value. Could you explain please?

Thanks,
TD
 

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

Top