Subform trouble

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I'm using Access 2000 and trying to link two separate existing forms (in the
same database), with the intention of one form being the master form and the
other being the subform.

The form is called 'Pump Process Data Sheet' and the subform is called 'Pump
Mechanical Data 1 (test)'

They are to be linked by a field called 'Equipment No' - this is the primary
key in 'Pump Process Data Sheet' and foreign key in 'Pump Mechanical Data 1
(test)'

Now this is all very well in design view, but when i try and switch to form
view I get the error message:

"The specified field '[Pump Mechanical Data 1 (test)].[Equipment No]' could
refer to more than one table listed in the FROM clause of your SQL statement"

This is confusing, as in the error message it clearly states the field and
table it is refering to. I'm not sure what a 'FROM clause' is though.

Also it maybe worth noting that there are other tables in this database and
that they too contain a field called 'Equipment No' but obviously have
different table names and aren't involved (as far as i'm aware) in the
subform shenanigans

If anyone could shed some light on this i'd appreciate it very much.

Regards

Alastair
 
Hi, Alastair.

A FROM clause is that part of an Structured Query Language (SQL) statement
that specifies the tables from which to select records for a query. In your
form, there may be an SQL statement in the form's RecordSource property and
in all combo boxes' Row Source property. Check each to see if all selected
fields are fully specified.

A quick way to get to know SQL syntax is to create a new query in Design
View, and then switch to SQL view (View, SQL View). Experiment--add sorting,
selection criteria, etc., and see how the SQL changes.

HTH
Sprinks
 
I think you can get that error message when you have used the asterisk to add
all of the fields to the query design grid, then also added the field
individually. Also, under circumstances I can't quite recall a query will
sometimes show a field as a calculated field with a generic label. Check
your query in design view. If a field is headed with something like
Someword1: [SomeField] that you didn't put there, delete it.
These suggestions are in addition to other suggestions you have already
received. Looking at a query in SQL view offers a chance to see what is
going on under the hood.
 
Back
Top