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!

REPORT QUERY

Status
Not open for further replies.

gneff

Technical User
Aug 24, 2002
15
US
I have a rather complicated question so I hope I can ask it correctly. I have written an estimating program for a construction company. Due to the large amount of pricing changes I have also added a change order form to the program so here is basic tables for original project or as I call it Jobmaster

tbl 1= Jobmaster
tbl 2= Takeoff
tbl 3= Jobcase

tbl 1 is basically the jobname and bid information
tbl 2 is the description qty and location on drawings of individual items
tbl 3 is the breakdown of the item such as parts

To enable Change orders I duplicated the tables and form and called them all the same name except I added a CO to each so I have a COJobmaster, COtakeoff, and COjobcase

when they need to change an item I wrote an export query that copies the original data to the new tables and they modify the pricing. Then I wrote a query that looks back at the original item and the new item and in a report I do the math that subtracts the total of the original item from the new COItem which is easy for the customer to follow. All this works fine. The Problem is that the changed item or COItem may change again so I have written an append query to copy the item into the cotable and the customer can input a new CO number. This works fine. What I do not know how to do is to get the report to look at the COTakeoff table to see if the item number exists and then deduct the amount of the CO Item and ignore the original pricing since a credit for that has already been issued. I am thinking I should do an IIf but do not know how to tell the query to look for an existing item with a diffrent co number and change the report to deduct that amount. I hope I am being clear it is a little beyond my abilities and any insights would be appreciated.
 
I have thought about it and what I need to do is this

IIf([COITEMNO]=EXISTS (THIS IS WHERE I AM LOST),[COITEMNO],[ITEMNO]

I don't know how to look at the CO table for a duplicate number so that I can have the report use the correct dollar amount to credit. I of course would IIF each of the fields I needed in the report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top