my Access form will not print preview...something about my SQL

S

Shell

I am trying to preview my form and the message keeps coming up " The
specified field 'PostalCode' could refer to more than one table listed in the
FROM clause of your SQL statement." Now PostalCode shows up in my Customer's
table and the table that it is linked to it callled table 1. The SQL
statement is taking the data from the PostalCode in table1. If I try to
change this to the Customer table it doesn't change anything. As far as I can
tell everything is correctly spelled.
Thanks for you help
Shell
 
S

Sprinks

Does your SQL statement specifically spell out which table, as in:

SELECT Table1.PostalCode ...

Sprinks
 
S

Shell

Yes it does.... that is exactly what it says.... I have a PostalCode in
table1 and in my Customers table.... The SQL statement takes it from Table1
 
S

Shell

Sure can...
SELECT [Table1].[CustomerID], [Table1].[CompanyName], [Table1].[FirstName],
[Table1].[LastName], [Table1].[BillingAddress], [Table1].[Table2_ID],
[Table2].[City/Town], [Table1].[PostalCode], [Table3].[Province],
[Table1].[PhoneNumber], [Table3].[FaxNumber], [Table1].[Notes]
FROM Table1 LEFT JOIN (Table2 LEFT JOIN Table3 ON
[Table2].[Table3_ID]=[Table3].[ID]) ON [Table1].[Table2_ID]=[Table2].[ID];

hope you can help....
Shell
 
D

Duane Hookom

Is your report's record source a saved query or is it the SQL statement? Try
to save it as a query and then try again.

One tip that makes my life much easier is that no two fields in an mdb have
the same name.

--
Duane Hookom
MS Access MVP


Shell said:
Sure can...
SELECT [Table1].[CustomerID], [Table1].[CompanyName],
[Table1].[FirstName],
[Table1].[LastName], [Table1].[BillingAddress], [Table1].[Table2_ID],
[Table2].[City/Town], [Table1].[PostalCode], [Table3].[Province],
[Table1].[PhoneNumber], [Table3].[FaxNumber], [Table1].[Notes]
FROM Table1 LEFT JOIN (Table2 LEFT JOIN Table3 ON
[Table2].[Table3_ID]=[Table3].[ID]) ON [Table1].[Table2_ID]=[Table2].[ID];

hope you can help....
Shell


Duane Hookom said:
Can you provide the SQL view of your form's record source?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top