Hello Everybody!
I can usually gain any knowledge I need from just reading and searching the forums, but this time I can't find the answer I am looking for. I need help with a not too-complicated Dlookup.
The basics,
Working with a functioning database, written by someone else, so I can't change the table structures.
Goal is to make my own reports, and I have made a few of them already, and they work fine.
My issue:
I have a query to supply data for one of these reports, so far it works.
I made the query, and it has 3 tables,
[Orders], [OrdersTimesHistory], and [OrdersParts]
all needed to make the report. This gives me the desired results.
But I want to add a field to my report from a different but related table. This table [OrdersPartsProcess] contains some step numbers [SEQ], which would make my report much more useful.
When I add this table to my query I get many more results than I need, probably because of the way the relationships have been made. I can't change the relationships or that would probably screw up things real good, right? I tried deleting the relationships in the query itself, but still too many results.
So, I thought I was smart and would do a dlookup from either a calculated field in the query, or a dlookup on the report itself (same results either way).
I thought I did it correctly (code the dlookup that is), but I seem to get the same value (1) for every record.
My latest version of the dlookup is:
And to further complicate things [OrdersTimesHistory]![ProcID] is text as opposed to [OrdersPartsProcess]![ProcID] which is numeric. Why the designer did this is beyond my comprehension, but I have to assume he had a good reason.
I need to get the [SEQ] on the report. I seem to be losing what is left of my hair !!!:banghead:
I can usually gain any knowledge I need from just reading and searching the forums, but this time I can't find the answer I am looking for. I need help with a not too-complicated Dlookup.
The basics,
Working with a functioning database, written by someone else, so I can't change the table structures.
Goal is to make my own reports, and I have made a few of them already, and they work fine.
My issue:
I have a query to supply data for one of these reports, so far it works.
I made the query, and it has 3 tables,
[Orders], [OrdersTimesHistory], and [OrdersParts]
all needed to make the report. This gives me the desired results.
But I want to add a field to my report from a different but related table. This table [OrdersPartsProcess] contains some step numbers [SEQ], which would make my report much more useful.
When I add this table to my query I get many more results than I need, probably because of the way the relationships have been made. I can't change the relationships or that would probably screw up things real good, right? I tried deleting the relationships in the query itself, but still too many results.
So, I thought I was smart and would do a dlookup from either a calculated field in the query, or a dlookup on the report itself (same results either way).
I thought I did it correctly (code the dlookup that is), but I seem to get the same value (1) for every record.
My latest version of the dlookup is:
Code:
DLookUp("[Seq]","[OrdersPartsProcess]","[OrderTimesHistory]![OrderID]=" & "[OrdersPartsProcess]![WOID]" AND "[OrdersTimesHistory]![ProcID]='" & "[OrdersPartsProcess]![ProcID]")
I need to get the [SEQ] on the report. I seem to be losing what is left of my hair !!!:banghead: