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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I link a sub form to my main form 1

Status
Not open for further replies.

ItIsHardToProgram

Technical User
Mar 28, 2006
946
CA
I might not be in the right forum section, or asking the right people since my question will seem to you prety stupid, but here goes.

I am presently writting down a simple mdb databse in access and I related a timesheet to that database...

My problem is the following, the timesheet is divised with subform That splits the time spent by projects. in that case, I have no way of coming with with any fonction that relates the subform to the form. I need those for a printable interface that I have made, but I am unable to copy the entered information in the subform to the cells in the form.

2nd(security): every form is divised by time sheet numbers and I would also like them to be divised by employee number, with a password ( not allowing employees to see other employees time sheet, and allowing the admins to see every time sheet).

Of course this is only 2 problems I have out of many.... and I won't give you a headache with my puzzling way of operating so I will stop there. I don't want any one to waste time into this unless you are willing to. I am ready to learn from scrapt(since I only know very very very basic vbase coding[ifs, loops and barely any commands.....], and I don't even know acces fonctions). So if you could at least point me to a tutorial, a free one since I am pratically pennyless, I would be glad to learn.

Thanks in advance for your help.

Julien Roy.

P.s. Sorry for the long thread.... but to me my problems are that complex......
 
Hey Julien,

We all started where you are at now. Maybe next time you should consider posting one problem at a time or posting seperate threads to keep your threads shorter and to the point.

So lets start with your time sheet form. What can you tell us about the tables and data that the main form collects. Or is it just a selection form?

What can you tell us about the subform? I would guess that it is based on a query that is summing up the projects and hours spent. What I didn't quite understand was the printable interface and copy information into the cells of the form.

Stix 42
Long Live Rock and Roll
Pop is for drinking
 
Ok let me enlighten you a bit.

To your first question, the data of the main form come from a querry that has multiple tables linked, to be more precise,

it comes from the table Employees(employee number + name + salary + function) (only the employee number, and the name are used),

the second table used is my timesheet table (Date its written + date1 (1st day week) + date2 (last day week) + employee number(link to the table employee) + timesheetnumber

Finaly, my subform , having employee number, linked to my main with timesheet number, Projet number(gets data from project table), project description (dlookup on projet table with the first one has criteria) the days of the week, sunday to saturday, And the total of the week.

From memory that is about right, If I remember correctly the relations between all those tables goes from employee to timesheet to subform to my Many to many table Project_to_contact.

Thus being, what I need is to be able to take the information just entered on the subform (the days, project number, desc, etc........ and place it on my main form, in textformated cells that look alot more ergonomic then the subform that is exactly like when u open a querry on access.

And so, once this is done, you press print, and print the main form, without the subform (that I can do) with the entrees of the subform.

The other thing I need to be done, is on that main table, a sum of all the Totals of hours, by project, on a seperated cell, since its all the same week.

I hope you get what I am saying... I don't really have the talent to organize my code yet, so when i explain it its all messed up.... :D.

The other problem, is not of the same type I think... you can enlighten me on that, of who could help me with my passwording and selecting problem....

Thanks a bunch for answering my thread.
 
Anyway, for printing in access, nothing is better than a Report ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You mentioned linked tables. What are they linked to? If it is a backend database? The reason I ask is because this has a baring on your security question.
 

I actually narrowed down my security problem, I only have my form problem to fix, which is kinda complicated since I need infos from my subform on my mainform, I found out a way with Me.Parent.Form![main txtbox] = Me![sub txtbox]
but since my sub form has more then one entry on the same handle, I can't have it copy other entrys on different txtboxes, if u get what i mean.
 
Can you create a table to bind to your sub-form? If you did that then your parent form could pull the data from that table.
 
But the table would still be reading the entrys with 1 handle, and I would be in the same position......... only solution I could be having would be having multiple handles on my subform, which would not even work since I could not select which project from which.
 
Have you tried a ListBox in your mainform ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That could work yes, but it wouldnt be the ergonomical effect I want it to be, I have the whole timesheet(mainform) in a certain way, where the projects are seperated by lines, the listbox would kill the effect I want it to have, I would just stay with the subform if I wanted that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top