J
Jen
I created a table with a lookup field to another table.
I've got a module in which I am using a SQL statement
based on the table with the lookup. For example:
sSQL = "Select * From CorporateExtVMX where Dept = '" &
Dpt & "'"
Dept is the field that is the lookup.
When running this code, I get the error message that a
parameter is blank. So I took this bit of code and
created a Query with it. I got a popup box to fill in
Dept.
Now, using the the Query wizard, I was able to create a
Query and the where clause in the SQL ended up
being "where Departmet = 'ACCOUNTING'" Note that this
time Department is spelled out. Department is the field
that is being looked up in the Dept table. But in my
CorporateVMXExt table, the field is Dept.
I apologize if I'm confusing anyone.
Okay, so I copied the Query SQL and posted it in the
Module SQL, so now it is this:
sSQL = "Select * From CorporateExtVMX where Department
= '" & Dpt & "'"
And after that I was getting the error message that
Department is not a field in the table. And it's not!
It's a field in the lookup table.
I guess my question is, how am I supposed to write a SQL
query on a table in which one field is looking up a table
from another table? This is driving me nuts!
Thanks,
Jennifer
I've got a module in which I am using a SQL statement
based on the table with the lookup. For example:
sSQL = "Select * From CorporateExtVMX where Dept = '" &
Dpt & "'"
Dept is the field that is the lookup.
When running this code, I get the error message that a
parameter is blank. So I took this bit of code and
created a Query with it. I got a popup box to fill in
Dept.
Now, using the the Query wizard, I was able to create a
Query and the where clause in the SQL ended up
being "where Departmet = 'ACCOUNTING'" Note that this
time Department is spelled out. Department is the field
that is being looked up in the Dept table. But in my
CorporateVMXExt table, the field is Dept.
I apologize if I'm confusing anyone.
Okay, so I copied the Query SQL and posted it in the
Module SQL, so now it is this:
sSQL = "Select * From CorporateExtVMX where Department
= '" & Dpt & "'"
And after that I was getting the error message that
Department is not a field in the table. And it's not!
It's a field in the lookup table.
I guess my question is, how am I supposed to write a SQL
query on a table in which one field is looking up a table
from another table? This is driving me nuts!
Thanks,
Jennifer