B
BBC
Have read at least 100 posts re #name errors and still can't figure out
what's wrong with mine.
I have a master form (and table, both called "Client") that has a (unique)
ClientID displayed (bound to the tables ClientID).
I have a child table that contains all (non-gound mail) contact "categories",
(ex: email, web site URL, phone, etc.), each of these having a "type" (ex for
phone: home, mobile, business, etc.). For each "category" the client can
select one as "primary".
On the main form I want to display the "primary" phone number in a textbox
and am trying to use the following query to get it:
(where "address" is the actual contact data, phone #, email,..and
is the only visible column)
(I've tried without the ![address] on the end, this was added when
I used the expression
builder so tried in one of my tests )
(a unbound field on the form called "phone" has it's control
source set to this query)
(hopefully have all the (..)'s right, couldn't copy/paste it here)
=(SELECT Contact.Address FROM Contact
WHERE (((Contact.ClientID)=[forms]![client]![clientid])
AND ((Contact.Category)="Phone") AND ((Contact.Primary)=True))!
[address]
This was originally built in Query Wizard and as long as the form is active
it actually works directly in the Wizard when I "run" it (it doesn't have the
![address] on it though). I copied/pasted the SQL to the control source (&
added the requested (..)'s until it stopped complaining). When the form runs
I get the #Name error in the "phone" textbox.
Very frustrating, surely can't be that hard ???
Thanks (sorry for the long post)
what's wrong with mine.
I have a master form (and table, both called "Client") that has a (unique)
ClientID displayed (bound to the tables ClientID).
I have a child table that contains all (non-gound mail) contact "categories",
(ex: email, web site URL, phone, etc.), each of these having a "type" (ex for
phone: home, mobile, business, etc.). For each "category" the client can
select one as "primary".
On the main form I want to display the "primary" phone number in a textbox
and am trying to use the following query to get it:
(where "address" is the actual contact data, phone #, email,..and
is the only visible column)
(I've tried without the ![address] on the end, this was added when
I used the expression
builder so tried in one of my tests )
(a unbound field on the form called "phone" has it's control
source set to this query)
(hopefully have all the (..)'s right, couldn't copy/paste it here)
=(SELECT Contact.Address FROM Contact
WHERE (((Contact.ClientID)=[forms]![client]![clientid])
AND ((Contact.Category)="Phone") AND ((Contact.Primary)=True))!
[address]
This was originally built in Query Wizard and as long as the form is active
it actually works directly in the Wizard when I "run" it (it doesn't have the
![address] on it though). I copied/pasted the SQL to the control source (&
added the requested (..)'s until it stopped complaining). When the form runs
I get the #Name error in the "phone" textbox.
Very frustrating, surely can't be that hard ???
Thanks (sorry for the long post)