Hello all I am playing around inner joins and have run into a problem. Here is my code
strsql = "SELECT Client.ClientName, Product.ProductID, Product.Product from Client " & _
"INNER JOIN Product ON Product.ClientID = Client.ClientID Where Client.ClientID = " & Val(txtClientID)
adorecordset.Open strsql, adoconnection, adOpenStatic, adLockReadOnly
adoconnection.Close
txtClientName = adorecordset!clientname
So My problem is with the last line. How to I reference a value in the returned recordset if a join is used. If I was not using a join, ie pulling data from 1 table I could have the following line of code
txtClientName = adorecordset!clientname
but this does not seem to work in this case??
thanks
strsql = "SELECT Client.ClientName, Product.ProductID, Product.Product from Client " & _
"INNER JOIN Product ON Product.ClientID = Client.ClientID Where Client.ClientID = " & Val(txtClientID)
adorecordset.Open strsql, adoconnection, adOpenStatic, adLockReadOnly
adoconnection.Close
txtClientName = adorecordset!clientname
So My problem is with the last line. How to I reference a value in the returned recordset if a join is used. If I was not using a join, ie pulling data from 1 table I could have the following line of code
txtClientName = adorecordset!clientname
but this does not seem to work in this case??
thanks