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

Conflicting FieldName captions in related tables

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
US
I have two related tables where the original designer assigned the same FieldName caption two fields in related tables. Hence, in table OrderHeader there is a field with a caption 'Name' and in table OrderDetail there is a different field with a caption 'Name'. My problem is that I am joining the two tables in a query and then I want to refer to the query values in a recordset. I cannot change (not my database) the table captions and table captions override any FieldNames you try to create in query view. So, in my recordset when I refer to rst.fields("Name") it does not know which 'Name' column I am refering to in the query. All other references to other rst.fields("") values work so the 'Name' duplication is clearly the problem. Any way to identify the correct query column in rst? Any other work around?
 
What if you tried something like this:

SELECT OrderDetail.Name As ODName, OrderHeader.Name as OHName etc...

then in your recordset you should have the fields ODName and OHName and be able to tell them apart.

Good luck

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top