Entering Data into one Table with help from other tables

G

Guest

First of all i'll give you a run down of my table structure:

tblClient - ClientID, Client name, Address, Phone

tblProject - ProjectID, Project Name, ClientID(from tblClient), Description

tblSubProject - SubProjectID, SubProjectName, ProjectID(from tblProject),
Description

tblTime - TimeID, Time, InorOut, SubProjectID(from tblSubProject)

I am trying to generate a form which means i can log when i start and stop
working on different sub projects. I want the form to be able to enter data
into all the fields of tblTime. How do I get it to input the SubProjectID by
having the user go through and first of all select the Client(by name not ID)
then select the Project by name (The ID is not know by the user and the name
will be different for the various clients but not neccessarily different for
two different clients and hence cannot be the primary key.). the user would
then obviosly select the correct sub project by name again and not ID.

Any help would be greatly appreciated. Let me know if this is unclear.

thanks,

James
 
J

Jeff L

I am assuming that when your users select the Client and the Project
that they are doing so via a combo box. That would make the most sense
anyway. When you set up your combo boxes, you want it to have the
ClientID and Client name in one, and the ProjectID and Project in
another. In the properites of each, you want it to be bound to column
1, have 2 columns, and set the column widths to 0;1. The second width
may need to be wider depending on your data. What this does is it
allows your user to see the value associated with a particular ID, but
the value of the combo box is the ID itself. Now when you assign a
Project to a Sub project on your subproject form, your dropdown list
will show the project names, but will actually save the ProjectID in
the table. The same concept would be true when you enter the times,
except your drop down would show all your Sub Projects.

Hope that helps!
 
G

Guest

Think that helps. thanks for quick response

Jeff L said:
I am assuming that when your users select the Client and the Project
that they are doing so via a combo box. That would make the most sense
anyway. When you set up your combo boxes, you want it to have the
ClientID and Client name in one, and the ProjectID and Project in
another. In the properites of each, you want it to be bound to column
1, have 2 columns, and set the column widths to 0;1. The second width
may need to be wider depending on your data. What this does is it
allows your user to see the value associated with a particular ID, but
the value of the combo box is the ID itself. Now when you assign a
Project to a Sub project on your subproject form, your dropdown list
will show the project names, but will actually save the ProjectID in
the table. The same concept would be true when you enter the times,
except your drop down would show all your Sub Projects.

Hope that helps!
 

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