Access 2007 Query Question

Each subcontractor is broken down by discipline. There are tank subs, stage subs, paint subs, sandblast subs, etc. So when subs turn in their quotes it is for a particular discipline broken down per work item. for example: a stage sub will send one quote that has all the stage work items and the quote will be broken down work item by work item showing what they would charge for man hours, material, and total for each work item within that discipline. Quotes can and will change depending on how often the scope of work changes for a particlular work item. There are 250 subcontactors that we solicit for work and out of those 250 each sub only does work on disciplines that they are experts at. Does that answer your question?
 
You asked this earlier:

So I'm finding that I have to enter the discipline/work item 8 times for each different quote into the last table....or is there a way to auto populate it?

The reason why I am asking all of the questions, is because I am trying to figure out how to automate the quote & work item addition.

What I am thinking is to have an unbound form with two multi-select list boxes. One list box would be for the quotes and the other for the disciplines. A button on the form would pull the selections from both append the appropriate records to the tblSubcontractorQuotes table via Visual Basic for application code. I'm just not sure how to filter those list boxes. We should be able to filter down to the applicable disciplines by using a combo box for the work items since there is a relationship there; I just do not know how to filter on the quote side since no current relationship exists between the subcontractor and the work items or the discipline.

You say this:
Each subcontractor is broken down by discipline
. Where do you show this relationship in your current tables?
 
I have attached a photo of the relationships that I have. Thanks
 

Attachments

  • photo relationships.jpg
    photo relationships.jpg
    101.2 KB · Views: 71
I am thinking that you need to define the discipline for each subcontractor so that you can filter their quotes in order to match to the disciplines of the work items

tblSubcontractors
-CompanyName primary key
-CompanyAddress
-fkDisciplineID foreign key to tblDisciplines (long integer number datatype field)

tblDisciplines
-pkDisciplineID primary key, autonumber
-txtDiscipline

The above table would include the various types of subs, each as a record:
tank, stage, paint, sandblast etc.

I think you might have to modify the following table as well. I assume that the Sub discipline field tells you whether it is tank, stage, paint, sandblast etc. Am I correct in my guess?

tblWorkRequired
-pk=Reference Number
-txt=Work Item Number
-txt=Sub Discipline
-txt=Turnkey
-txt=Make Buy Sub
-txt=Have to Sub
-dte=Date of Revision
-txt=Type of Contract

Replace the discipline field with a foreign key reference to tblDisciplines

tblWorkRequired
-pk=Reference Number
-txt=Work Item Number
-fkDisciplineID foreign key to tblDisciplines (long integer number datatype field)
-txt=Turnkey
-txt=Make Buy Sub
-txt=Have to Sub
-dte=Date of Revision
-txt=Type of Contract
 
attached is what I have changed....
 

Attachments

  • photo (2).jpg
    photo (2).jpg
    100.5 KB · Views: 73
You should be joining the tables by the ID field not the text field. Also, where is the discipline in the company/subcontractor table?

BTW, instead of taking a photo, maximize the relationship window then use Shift+PrtScn. Then paste into a Word document and post the Word document
 
ok got it. I added a discipline column to the tbl_subcontractors. I cannot upload word documents that is why I am taking pictures....might be a work restriction or something
 
OK. What was your vision for your form to associate quotes to the required work? My vision is probably totally different from yours.
 
The form should be in datasheet view...other than that I don't have a vision just whatever works best. Let me know your thoughts. Thanks for your help
 
Datasheet view would be fine for viewing existing records and/or when you are adding records manually, but I was referring to the form that would be used for automating the process of adding larger groups of records at a time. In that form as mentioned previously, I see a couple of list boxes, one for the quotes and one for the required work disciplines.
 
Since doing this will require Visual Basic for Application (VBA) code, it would be best to work with your actual tables & fields since the naming has to be exact in VBA for anything to work correctly. So, is there some way that you can post your current database with any sensitive data altered or removed?
 
Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.

This is the error that I get when I try to upload. I could email it to you?
 
This is the error that I get when I try to upload. I could email it to you?

I used to provide access to my e-mail address, but that did not work out well, so I prefer to do everything through the forum.

Could you post from outside of work?
 
I tried that doesn't work either....so I can give you the naming conventions...and you can walk me through how to put the code? Will that work ? Thanks

This is exactly how I have the tables named:

tbl_Disciplines
tbl_RateTypes
tbl_SubcontractorQuotes
tbl_SubcontractorRates
tbl_Subcontractors
tbl_WorkItems
tbl_WorkRequired
 
I would start with an unbound form. Add 2 multiselect list boxes to the form. One list box should be based on the required work while the other would be based on the quotes. You will need to include the key fields of both tables in the listbox, but you can hide the value to the user. When you set the multiselect property of the list boxes, you want to choose extended (not simple).

You may want to include a combo box based on the category to filter both the quotes and the required work listboxes so that only relevant quotes/required work are shown.

Then add a button to the form. The code will go in the on click event of that button.

I'll let you get that part set up first.
 
Ok i came up with an idea to upload my sample db to the internet because I have no idea what you are talking about lol :banghead:

Here is the site:

www.drivehq.com

my login is: lowanam1
password : shiprepair2009
 
The fields needed in the quote form are

work item, title, work required, sub discipline, Sub Quotes 1-8
 
I was able to download the file, but a database password is required.
 

Users who are viewing this thread

Back
Top Bottom