G
Guest
I am trying to display a field (DestinationType) from a foreign table on my
form header.
Table: GuatemalaDB
Form: TextForm
Foreign key: Destination
Foreign key properties-------
Row Source Type: TABLE/QUERY
Row Source: SELECT GuatemalaDestinations.GuatemalaDID,
GuatemalaDestinations.Destination FROM GuatemalaDestinations;
Foreign table: GuatemalaDestinations
Field: DestinationType
Foreign table key: GuatemalaDID
In design view, I have pasted variations on the following into a text
control that I created on the form header:
=DLookup("[DestinationType]", "GuatemalaDestinations", "[GuatemalaDID] =" _
& Forms![TextForm]!GuatemalaDID)
=DLookup("[DestinationType]", "GuatemalaDestinations", "[GuatemalaDID] =" _
& Forms![TextForm]!Destination)
Neither of these works and I get the following message:
The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid character or
comma, or you entered text without surrounding it in quotation marks
I have no problem selecting records from the foreign table and displaying
them on my subform using the foreign key, but I wish to also show
DestinationType on the form header.
Thank you
Peter
form header.
Table: GuatemalaDB
Form: TextForm
Foreign key: Destination
Foreign key properties-------
Row Source Type: TABLE/QUERY
Row Source: SELECT GuatemalaDestinations.GuatemalaDID,
GuatemalaDestinations.Destination FROM GuatemalaDestinations;
Foreign table: GuatemalaDestinations
Field: DestinationType
Foreign table key: GuatemalaDID
In design view, I have pasted variations on the following into a text
control that I created on the form header:
=DLookup("[DestinationType]", "GuatemalaDestinations", "[GuatemalaDID] =" _
& Forms![TextForm]!GuatemalaDID)
=DLookup("[DestinationType]", "GuatemalaDestinations", "[GuatemalaDID] =" _
& Forms![TextForm]!Destination)
Neither of these works and I get the following message:
The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid character or
comma, or you entered text without surrounding it in quotation marks
I have no problem selecting records from the foreign table and displaying
them on my subform using the foreign key, but I wish to also show
DestinationType on the form header.
Thank you
Peter