Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default values in subform based on values of another subform

Status
Not open for further replies.

airtabaki

Technical User
Aug 7, 2003
31
BE
I've made a database where I can note the hours of all the people who work for me. Now I've got a mainform where I give some average information per day(every record is another day). In the subform I can note how many hours every one has been working for me for that day. Because these information is allmost the same for some days I want to copy the information of a subform of another day in the subform I been working in.
 
Hi, in brief, the code will be along the lines of....

[Forms]![Formname]![subformname]![fieldname] = [Forms]![Formname]![othersubformname]![otherfieldname]

Repeat as much as necessary. You could put this code in the OnLoad property of a subform. Or even behind a button called Copy.

Hope this was of help,

David
 
My subform: primary key: Date and Name
field: Hours (how many hours has one person worked that day),...
My mainform: Primary key: Date
fields: some global information

I have a form that displays for every record a new day. This form filters the sub form on Date so that I can see the persons that have been working and the hours that they have been working only for that day.
My problem is that every day I have to write all the names who have been working for me all over again. What I want to do is copying the records (for instance the records of the day before)and paste them in the records for the current day (only the date field changes) so I just have to change the records a bit. I know the code that you have given to me, but how do I make sure that all the records of the day before are copied and pasted but in that way that the date field is of the current day?

 
Ok...

To help you out would you be able to give me the details of the field name you use?

It is something like...

[Employee's]
EmployeeID, Name, etc...

[HoursWorked]
HoursWorkedID, EmployeeID, Date, Start, Finish?

In your subform, where you click to enter the date, you could have a onClick property of the start and finish times, so when clicked, it automatically enters the persons name. This field can also be invisible, so it'll work perfectly and the end user will never see this happening.

I'll try and help you out the best I can, but I'm no expert.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top