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!

Referencing columns in join with same name

Status
Not open for further replies.

iejerry

Programmer
Oct 9, 2001
17
US
How do I reference (qualify) two columns with the same name in vb code? I have a join where I select the Name column from the Job table and the Name column from the Employee table. (This is a vendor "designed" database and can't be changed.) I've always just used something like

txtName.text = Rst!Name

What would I use to complete:
txtJobName.text =
and
txtEmployeeName.text =

Thanks!

 
Similarly named columns in a JOIN must be referenced directly using either an alias or table name prefix with the column name in the SQL statement or you'll get an ambiguous column name error.

Try:

txtJobName.text = rst!JobTableName.Name
and
txtEmployeeName.text = rst!EmployeeTableName.Name


Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top