T
Tim Rogers
There is a table (let's call it A) in our Access97 application that
has a column that is a combo box lookup. This lookup is a select
statement of an ID (PK) and a friendly name from another table (let's
call it B). The bound column is 1, as expected.
The 'weirdness' comes in with the form that manipulates table A.
There is a combo box on this form that does the same lookup, on table
B, as described above, but it UNIONs this lookup with a hard-coded
string value. So, the user can now select values from table B as well
as this string value to be data in the aforementioned column in table
A.
The issue I'm dealing with is trying to query table A. There is a
query that isn't working as expected. The query was built using the
Query builder and it recognized the relationship between the column in
table A and the Id column in table B. This select query does not
bring back rows in table A that have the hard-coded string value in
the column in question.
This may be poor design, but at this point I've got to fix this query
to bring back the appropriate rows. So, what I thought I could do is
use the existing query and then UNION it with another select query on
table A in which the WHERE clause would simply look for rows in table
A where that column matches the hard-coded string value. This union
would give me the result set I need. The problem is the WHERE clause
fails to make the match I think it should. Is there something special
I need to do to match this string value, in a query, given the fact
that the column in table A is a lookup column?
When I look at table A's data, I see many rows with the column 2
values from the select statement on table B as I expect. I also see
the hard-coded string value in many rows as well. This column in
table A is bound to column 1 of a query, but displays column 2. So, I
don't know what this means when some hard-coded string is entered as a
value for this column. It doesn't seem like anything good could come
from doing this.
Any help would be much appreciated.
Thanks,
Tim Rogers
has a column that is a combo box lookup. This lookup is a select
statement of an ID (PK) and a friendly name from another table (let's
call it B). The bound column is 1, as expected.
The 'weirdness' comes in with the form that manipulates table A.
There is a combo box on this form that does the same lookup, on table
B, as described above, but it UNIONs this lookup with a hard-coded
string value. So, the user can now select values from table B as well
as this string value to be data in the aforementioned column in table
A.
The issue I'm dealing with is trying to query table A. There is a
query that isn't working as expected. The query was built using the
Query builder and it recognized the relationship between the column in
table A and the Id column in table B. This select query does not
bring back rows in table A that have the hard-coded string value in
the column in question.
This may be poor design, but at this point I've got to fix this query
to bring back the appropriate rows. So, what I thought I could do is
use the existing query and then UNION it with another select query on
table A in which the WHERE clause would simply look for rows in table
A where that column matches the hard-coded string value. This union
would give me the result set I need. The problem is the WHERE clause
fails to make the match I think it should. Is there something special
I need to do to match this string value, in a query, given the fact
that the column in table A is a lookup column?
When I look at table A's data, I see many rows with the column 2
values from the select statement on table B as I expect. I also see
the hard-coded string value in many rows as well. This column in
table A is bound to column 1 of a query, but displays column 2. So, I
don't know what this means when some hard-coded string is entered as a
value for this column. It doesn't seem like anything good could come
from doing this.
Any help would be much appreciated.
Thanks,
Tim Rogers