Error in Expression Builder query...

G

Guest

I need to implement the following logic in a report column in Access 97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X","" ))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
B

Brendan Reynolds

Try adding square brackets around the table names and field names. In the
example below I've put spaces either side of the square brackets because
they were difficult to see otherwise, but this is just for illustration,
don't add those extra spaces in the real expression ...
=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] ! [
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ] ,"X","" ))

Alternatively, if your form's record source does not include fields with the
same name from different tables, you may be able to leave out the table
names altogether and just use the field names ...
=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))
 
G

Guest

I did that (adding square brackets around table and field names and leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it works fine.
It is referencing fields that causes the problem (even =tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the table
the recordsource is referencing? I cannot do that because it is an attached
table and, hence, cannot be changed.

Thanks.

Brendan Reynolds said:
Try adding square brackets around the table names and field names. In the
example below I've put spaces either side of the square brackets because
they were difficult to see otherwise, but this is just for illustration,
don't add those extra spaces in the real expression ...
=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] ! [
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ] ,"X","" ))

Alternatively, if your form's record source does not include fields with the
same name from different tables, you may be able to leave out the table
names altogether and just use the field names ...
=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))

--
Brendan Reynolds
Access MVP

Mark said:
I need to implement the following logic in a report column in Access 97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
B

Brendan Reynolds

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


Mark said:
I did that (adding square brackets around table and field names and leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

Brendan Reynolds said:
Try adding square brackets around the table names and field names. In the
example below I've put spaces either side of the square brackets because
they were difficult to see otherwise, but this is just for illustration,
don't add those extra spaces in the real expression ...
=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] ! [
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ] ,"X","" ))

Alternatively, if your form's record source does not include fields with
the
same name from different tables, you may be able to leave out the table
names altogether and just use the field names ...
=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))

--
Brendan Reynolds
Access MVP

Mark said:
I need to implement the following logic in a report column in Access 97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
G

Guest

The Record Source property of the form references an Access table (called
REPORT_CLIENT). This table is attached to an Oracle table of the same name.
The Control Source values of the other textboxes in the report are simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


Brendan Reynolds said:
What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


Mark said:
I did that (adding square brackets around table and field names and leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

Brendan Reynolds said:
Try adding square brackets around the table names and field names. In the
example below I've put spaces either side of the square brackets because
they were difficult to see otherwise, but this is just for illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] ! [
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ] ,"X","" ))

Alternatively, if your form's record source does not include fields with
the
same name from different tables, you may be able to leave out the table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in Access 97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
B

Brendan Reynolds

Your expression is attempting to refer to fields that are not in the form's
record source. In order to refer to fields in the tables 'HIST_MIS_CDS' and
'HIST_CODE_TRANSLATION' your form's record source would need to be a query
that included those tables. Alternatively, you might be able to use the
DLookup function.

The only fields that you can refer to directly in expressions (without using
domain aggregate functions such as DLookup or custom code) are fields that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


Mark said:
The Record Source property of the form references an Access table (called
REPORT_CLIENT). This table is attached to an Oracle table of the same
name.
The Control Source values of the other textboxes in the report are simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


Brendan Reynolds said:
What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


Mark said:
I did that (adding square brackets around table and field names and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the
table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field names. In
the
example below I've put spaces either side of the square brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] !
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include fields
with
the
same name from different tables, you may be able to leave out the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
G

Guest

Great. Thanks!

How do I create a query form's record source that will include these fields?
Would it be a regular Jet-SQL query, like "SELECT * from REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


Brendan Reynolds said:
Your expression is attempting to refer to fields that are not in the form's
record source. In order to refer to fields in the tables 'HIST_MIS_CDS' and
'HIST_CODE_TRANSLATION' your form's record source would need to be a query
that included those tables. Alternatively, you might be able to use the
DLookup function.

The only fields that you can refer to directly in expressions (without using
domain aggregate functions such as DLookup or custom code) are fields that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


Mark said:
The Record Source property of the form references an Access table (called
REPORT_CLIENT). This table is attached to an Oracle table of the same
name.
The Control Source values of the other textboxes in the report are simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


Brendan Reynolds said:
What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the
table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field names. In
the
example below I've put spaces either side of the square brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ] !
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include fields
with
the
same name from different tables, you may be able to leave out the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC] ,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated field.

Any ideas? Thanks.
 
B

Brendan Reynolds

You will need to join the tables. (SELECT * FROM SomeTable INNER JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField). As I do
not know how the tables are related, I can not say what the join should be.

--
Brendan Reynolds
Access MVP


Mark said:
Great. Thanks!

How do I create a query form's record source that will include these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


Brendan Reynolds said:
Your expression is attempting to refer to fields that are not in the
form's
record source. In order to refer to fields in the tables 'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to be a
query
that included those tables. Alternatively, you might be able to use the
DLookup function.

The only fields that you can refer to directly in expressions (without
using
domain aggregate functions such as DLookup or custom code) are fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


Mark said:
The Record Source property of the form references an Access table
(called
REPORT_CLIENT). This table is attached to an Oracle table of the same
name.
The Control Source values of the other textboxes in the report are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the
table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field names.
In
the
example below I've put spaces either side of the square brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include fields
with
the
same name from different tables, you may be able to leave out the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated
field.

Any ideas? Thanks.
 
G

Guest

Thanks. I did create a query that joins the 3 tables on the ID field, but
when I run it, I get the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

I don't get this error when the RecordSource property only points to that
single REPORT_CLIENT table. I get this error when I join the HIST_MIS_CDS
and HIST_CODE_TRANSLATION tables. All tables are in the same database, so I
don't know why the error should occur.

Thanks again!


Brendan Reynolds said:
You will need to join the tables. (SELECT * FROM SomeTable INNER JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField). As I do
not know how the tables are related, I can not say what the join should be.

--
Brendan Reynolds
Access MVP


Mark said:
Great. Thanks!

How do I create a query form's record source that will include these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


Brendan Reynolds said:
Your expression is attempting to refer to fields that are not in the
form's
record source. In order to refer to fields in the tables 'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to be a
query
that included those tables. Alternatively, you might be able to use the
DLookup function.

The only fields that you can refer to directly in expressions (without
using
domain aggregate functions such as DLookup or custom code) are fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


The Record Source property of the form references an Access table
(called
REPORT_CLIENT). This table is attached to an Oracle table of the same
name.
The Control Source values of the other textboxes in the report are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the
table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field names.
In
the
example below I've put spaces either side of the square brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include fields
with
the
same name from different tables, you may be able to leave out the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated
field.

Any ideas? Thanks.
 
G

Guest

This is the query I have in the RecordSource property of the Form:

"SELECT *
FROM (REPORT_CLIENT INNER JOIN HIST_MIS_CDS ON REPORT_CLIENT.ID =
HIST_MIS_CDS.ID) INNER JOIN HIST_CODE_TRANSLATION ON REPORT_CLIENT.ID =
HIST_CODE_TRANSLATION.ID;"

Running this gives the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

Any suggestions? I don't know what GMIS_TEST.WORLD is.



Mark said:
Thanks. I did create a query that joins the 3 tables on the ID field, but
when I run it, I get the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

I don't get this error when the RecordSource property only points to that
single REPORT_CLIENT table. I get this error when I join the HIST_MIS_CDS
and HIST_CODE_TRANSLATION tables. All tables are in the same database, so I
don't know why the error should occur.

Thanks again!


Brendan Reynolds said:
You will need to join the tables. (SELECT * FROM SomeTable INNER JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField). As I do
not know how the tables are related, I can not say what the join should be.

--
Brendan Reynolds
Access MVP


Mark said:
Great. Thanks!

How do I create a query form's record source that will include these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


:

Your expression is attempting to refer to fields that are not in the
form's
record source. In order to refer to fields in the tables 'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to be a
query
that included those tables. Alternatively, you might be able to use the
DLookup function.

The only fields that you can refer to directly in expressions (without
using
domain aggregate functions such as DLookup or custom code) are fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


The Record Source property of the form references an Access table
(called
REPORT_CLIENT). This table is attached to an Oracle table of the same
name.
The Control Source values of the other textboxes in the report are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.) it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to the
table
the recordsource is referencing? I cannot do that because it is an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field names.
In
the
example below I've put spaces either side of the square brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [ HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include fields
with
the
same name from different tables, you may be able to leave out the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation! src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated
field.

Any ideas? Thanks.
 
B

Brendan Reynolds

Sorry, Mark, I'm afraid I don't have any further suggestion - possibly
because I have no Oracle experience. Perhaps someone familiar with Oracle
might be able to suggest something?

--
Brendan Reynolds
Access MVP


Mark said:
This is the query I have in the RecordSource property of the Form:

"SELECT *
FROM (REPORT_CLIENT INNER JOIN HIST_MIS_CDS ON REPORT_CLIENT.ID =
HIST_MIS_CDS.ID) INNER JOIN HIST_CODE_TRANSLATION ON REPORT_CLIENT.ID =
HIST_CODE_TRANSLATION.ID;"

Running this gives the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

Any suggestions? I don't know what GMIS_TEST.WORLD is.



Mark said:
Thanks. I did create a query that joins the 3 tables on the ID field, but
when I run it, I get the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

I don't get this error when the RecordSource property only points to that
single REPORT_CLIENT table. I get this error when I join the
HIST_MIS_CDS
and HIST_CODE_TRANSLATION tables. All tables are in the same database, so
I
don't know why the error should occur.

Thanks again!


Brendan Reynolds said:
You will need to join the tables. (SELECT * FROM SomeTable INNER JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField). As I
do
not know how the tables are related, I can not say what the join should
be.

--
Brendan Reynolds
Access MVP


Great. Thanks!

How do I create a query form's record source that will include these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from
REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


:

Your expression is attempting to refer to fields that are not in the
form's
record source. In order to refer to fields in the tables
'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to be a
query
that included those tables. Alternatively, you might be able to use
the
DLookup function.

The only fields that you can refer to directly in expressions
(without
using
domain aggregate functions such as DLookup or custom code) are
fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


The Record Source property of the form references an Access table
(called
REPORT_CLIENT). This table is attached to an Oracle table of the
same
name.
The Control Source values of the other textboxes in the report are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names
and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.)
it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to
the
table
the recordsource is referencing? I cannot do that because it is
an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field
names.
In
the
example below I've put spaces either side of the square
brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [
HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include
fields
with
the
same name from different tables, you may be able to leave out
the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation!
src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder
for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated
field.

Any ideas? Thanks.
 
G

Guest

Thanks. But I think this is an Access error or could it be trying to make an
ODBC connection to Oracle? The tables mentioned in the query are Access
tables attached to Oracle tables of the same name.



Brendan Reynolds said:
Sorry, Mark, I'm afraid I don't have any further suggestion - possibly
because I have no Oracle experience. Perhaps someone familiar with Oracle
might be able to suggest something?

--
Brendan Reynolds
Access MVP


Mark said:
This is the query I have in the RecordSource property of the Form:

"SELECT *
FROM (REPORT_CLIENT INNER JOIN HIST_MIS_CDS ON REPORT_CLIENT.ID =
HIST_MIS_CDS.ID) INNER JOIN HIST_CODE_TRANSLATION ON REPORT_CLIENT.ID =
HIST_CODE_TRANSLATION.ID;"

Running this gives the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

Any suggestions? I don't know what GMIS_TEST.WORLD is.



Mark said:
Thanks. I did create a query that joins the 3 tables on the ID field, but
when I run it, I get the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

I don't get this error when the RecordSource property only points to that
single REPORT_CLIENT table. I get this error when I join the
HIST_MIS_CDS
and HIST_CODE_TRANSLATION tables. All tables are in the same database, so
I
don't know why the error should occur.

Thanks again!


:

You will need to join the tables. (SELECT * FROM SomeTable INNER JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField). As I
do
not know how the tables are related, I can not say what the join should
be.

--
Brendan Reynolds
Access MVP


Great. Thanks!

How do I create a query form's record source that will include these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from
REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


:

Your expression is attempting to refer to fields that are not in the
form's
record source. In order to refer to fields in the tables
'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to be a
query
that included those tables. Alternatively, you might be able to use
the
DLookup function.

The only fields that you can refer to directly in expressions
(without
using
domain aggregate functions such as DLookup or custom code) are
fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


The Record Source property of the form references an Access table
(called
REPORT_CLIENT). This table is attached to an Oracle table of the
same
name.
The Control Source values of the other textboxes in the report are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field names
and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(), etc.)
it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field to
the
table
the recordsource is referencing? I cannot do that because it is
an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field
names.
In
the
example below I've put spaces either side of the square
brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [
HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [ SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not include
fields
with
the
same name from different tables, you may be able to leave out
the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation!
src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression Builder
for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the calculated
field.

Any ideas? Thanks.
 
B

Brendan Reynolds

The error message says it is trying to make an ODBC connection to
*something*, Mark, and if not to Oracle, then to what else would it be
trying to make an ODBC connection?

You might be able to narrow down the problem by a process of elimination.
Have you tried running your query independently of the form? Create a new
query, switch to SQL View, and paste in your SQL statement. Now switch to
Datasheet view. Do you still get the error message? If not, then the problem
is not in the SQL statement, but in some other property of the form.

If you still get the error message when trying to run the query
independently of the form, try narrowing it down a bit further by joining
just two of the tables instead of three.

--
Brendan Reynolds
Access MVP

Mark said:
Thanks. But I think this is an Access error or could it be trying to make
an
ODBC connection to Oracle? The tables mentioned in the query are Access
tables attached to Oracle tables of the same name.



Brendan Reynolds said:
Sorry, Mark, I'm afraid I don't have any further suggestion - possibly
because I have no Oracle experience. Perhaps someone familiar with Oracle
might be able to suggest something?

--
Brendan Reynolds
Access MVP


Mark said:
This is the query I have in the RecordSource property of the Form:

"SELECT *
FROM (REPORT_CLIENT INNER JOIN HIST_MIS_CDS ON REPORT_CLIENT.ID =
HIST_MIS_CDS.ID) INNER JOIN HIST_CODE_TRANSLATION ON REPORT_CLIENT.ID =
HIST_CODE_TRANSLATION.ID;"

Running this gives the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

Any suggestions? I don't know what GMIS_TEST.WORLD is.



:

Thanks. I did create a query that joins the 3 tables on the ID field,
but
when I run it, I get the error:

"ODBC-connection to GMIS_TEST.WORLD failed"

I don't get this error when the RecordSource property only points to
that
single REPORT_CLIENT table. I get this error when I join the
HIST_MIS_CDS
and HIST_CODE_TRANSLATION tables. All tables are in the same database,
so
I
don't know why the error should occur.

Thanks again!


:

You will need to join the tables. (SELECT * FROM SomeTable INNER
JOIN
SomeOtherTable ON SomeTable.SomeField = SomeOtherTable.SomeField).
As I
do
not know how the tables are related, I can not say what the join
should
be.

--
Brendan Reynolds
Access MVP


Great. Thanks!

How do I create a query form's record source that will include
these
fields?
Would it be a regular Jet-SQL query, like "SELECT * from
REPORT_CLIENT,
field1 from HIST_MIS_CDS, field2 from HIST_CODE_TRANSLATION"?


:

Your expression is attempting to refer to fields that are not in
the
form's
record source. In order to refer to fields in the tables
'HIST_MIS_CDS'
and
'HIST_CODE_TRANSLATION' your form's record source would need to
be a
query
that included those tables. Alternatively, you might be able to
use
the
DLookup function.

The only fields that you can refer to directly in expressions
(without
using
domain aggregate functions such as DLookup or custom code) are
fields
that
are included in the record source of the form.

--
Brendan Reynolds
Access MVP


The Record Source property of the form references an Access
table
(called
REPORT_CLIENT). This table is attached to an Oracle table of
the
same
name.
The Control Source values of the other textboxes in the report
are
simply
fields in the REPORT_CLIENT table.

Your help is greatly apreciated. Thanks.


:

What is the value of the RecordSource property of the form?

--
Brendan Reynolds
Access MVP


I did that (adding square brackets around table and field
names
and
leaving
out the table names) but get the same error.

If I give a function without a fieldname (eg., Trim$(),
etc.)
it
works
fine.
It is referencing fields that causes the problem (even
=tablename!fieldname
gives the same error).

Any other suggestions? Do I need to add the calculated field
to
the
table
the recordsource is referencing? I cannot do that because it
is
an
attached
table and, hence, cannot be changed.

Thanks.

:

Try adding square brackets around the table names and field
names.
In
the
example below I've put spaces either side of the square
brackets
because
they were difficult to see otherwise, but this is just for
illustration,
don't add those extra spaces in the real expression ...

=IIf( [ HIST_MIS_CDS ] ! [ TYPGESS ] ="","",IIf( [
HIST_MIS_CDS ]
!
[
TYPGESS ] <> [ HIST_CODE_TRANSLATION ] ! [
SRC_CODE_DESC ]
,"X","" ))

Alternatively, if your form's record source does not
include
fields
with
the
same name from different tables, you may be able to leave
out
the
table
names altogether and just use the field names ...

=IIf( [TYPGESS] ="","",IIf( [TYPGESS] <> [SRC_CODE_DESC]
,"X","" ))

--
Brendan Reynolds
Access MVP

I need to implement the following logic in a report column
in
Access
97:

IF hist_mis_cds!typgess = "", then calculated field= ""
ELSE
IF hist_mis_cds!typgess <> hist_code_translation!
src_code_desc
then calculated field= "X"
ELSE calculated field= ""

I have implemented the following query in Expression
Builder
for
the
calculated field:

=IIf(HIST_MIS_CDS!TYPGESS="","",IIf(HIST_MIS_CDS!TYPGESS<>HIST_CODE_TRANSLATION!SRC_CODE_DESC,"X",""
))

When I click on Form View, I get "#Name?" in the
calculated
field.

Any ideas? Thanks.
 

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