A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ambiguous fields name



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2004, 09:38 AM
Naturalkiller3000
external usenet poster
 
Posts: n/a
Default ambiguous fields name

I use MS Access 2000 as front end, database is MS SQL 2000
as back end .
I have 2 tables : [Student] and [Teacher] . I want to
query whole student of a teacher (for example : "Peter") .
I make a query that:
Student(Code,Name,Description,TeacherCode)
Teacher(Code,Name,Description)
"Select * from dbo.Teacher INNER JOIN dbo.Student ON
dbo.Teacher.Code=dbo.Student.TeacherCode"

when I use [WhereCondition] in Docmd.OpenReport. I write
Docmd.OpenReport "rptClass", acViewPreview, , "
dbo.Teacher.Code='Peter' "

It throws an error :
"The column prefix 'dbo.Teacher' does not match with a
table name or alias name used in the query"

because there are 2 fields name is "Code" (one in Student
Table and one is Teacher Table) so I have to use Table
Name (to different them).

Notes :I don't want to write (get from Student.TeacherCode)
Docmd.OpenReport "rptClass", acViewPreview, , "
dbo.TeacherCode='Peter' "

Thank a lot

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ambiguous fields name Minh Luan Setting Up & Running Reports 1 August 12th, 2004 02:09 PM
"UNION" Query with different fields in the two tables Dkline Running & Setting Up Queries 5 July 30th, 2004 09:05 PM
How to ignore fields in Update Query Casa Running & Setting Up Queries 6 July 12th, 2004 12:46 AM
Lookup fields on label report Howard Setting Up & Running Reports 1 June 3rd, 2004 02:43 AM
Calculating fields for Access Galin New Users 6 May 5th, 2004 12:05 AM


All times are GMT +1. The time now is 09:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.