Persistant form data

silversurfer19

Registered User.
Local time
Today, 19:46
Joined
Aug 20, 2008
Messages
26
Hi, I'm having what I think must be a fairly easy to solve problem (I hope) but I really can't sort it out.

I've created a data entry form for the table timesheets. This form is used to enter time sheets data on an almost daily basis for previous days, containing details about what employees were doing and for how long. In an effort to speed up the data entry I've used combo boxes for things such as employee name, process etc. As the data being entered tends to be coming from one date's worth of sheets at a time, and then from one employee's sheet at a time, it would also greatly speed the process if the user only had to enter the employee name and the date once, before moving on to the next record, while the data entered into these two fields remains persistant until altered specifically by the user. In an effort to achieve this I created a main form and sub form. The main form contains the employee and date, and then the sub-form everything else. When entering the data into the forms this gives the desired effect, the two values on the main form persist. However, when I checked the table I found that altho the employee name had been added correctly to every record, the date had only been added to one record at the beginning of each new employee, which contained nothing else but the employee name.
I suspect that I have not gone about solving this problem in the correct way, and would greatly appreciate any help that can be provided. (We'd already started to use the system before I noticed the problem, so it needs solved asap) :S:(
Thank you in advance,
 
Simple Software Solutions

I assume your timesheet table is a child of the employee table with the employee ID as a FK.

On your subform, which should be bound to the timesheets table, you will need to have a bound textbox that refers to the data on the main form by default which is bound to the date field in the timesheet table. So when you add a new record it will automatically pick up the date form the main form and populates the date field in the timesheet table.

CodeMaster:
 
Yes, there is a seperate employee table, and they are linked using Employee name as the FK. Please can you tell me what the easiest way to do what you just described is? I know it's probably not that difficult, but I just want to make sure I get it right.
Many thanks
 
Simple Software Solutions

For a start I would not use the employee name as the FK I would use the PK in the employee table as the FK in the timesheet table.

What happens if Susan Jones gets married if you change here name you will lose any referential integrity you had.

post a sample of you mdb and I will look at it for you.

David
 
The Employee Name is the PK in the Employee Table. I'm aware that this is not the way to go about doing things, but I don't have the luxury of telling the company that they have to assign a number to every employee and alter their time sheets so that they show this instead. It's a small company, so the chances of them ever having two members of staff with the same name are very small. Even so, there is currently an employee number field in the employee table, but it's unpopulated. With luck I can attempt to change that system to an employee number at a later date.

The Database is far too large to post (the time sheets table is just a small part). :( I just need to know how to link a text box in the subform to the date field in the main form, and in turn use this to populate the table.
Sorry I can't be more helpful, thanks again.
 

Users who are viewing this thread

Back
Top Bottom