G
Guest
I am a novice wrt database design and desperately need help.
I have a table containing all things of type X, and another table containing
things of type R. Each R needs to refer to a subset of X, and there are many
Rs and many Xs. For example R1 needs to be associated with X3, X67, X92 and
X99, R5 needs to be associated with X13 and X67, R12 with X2, X3 and X4, and
so on.
My first thought (using generic C language terminology) is to implement this
as an attrribute of R which is a pointer to an array of pointers to specific
Xs. In otehr words, to somehow give R a field called say Xpointer. This
way, using my previous example, For R5 I could give Xpointer a value of
"Xarray5" and have "Xarray5" be a 1 column table (i.e. array)with fields name
Ptr containing values 13 and 67. Then I could create a query that says, in
effect, SELECT * FROM [X] WHERE [Xarray5]![Ptr] = [X]![ID]. I can't figure
out how to do this so that, for many Rs, I can create a single query with a
variable for the pointer array table name, something like "SELECT * FROM [X]
WHERE " & [R]![Xpointer] & " ![Ptr] = [X]![ID]" and have that concatenated
string somehow "be" an SQL statement.
Is there a way to do this? OR am I doing this all wrong? I realized
yesterday there are other ways to do it, such as added lots of columns to
table [X], one for each R, and simply entering a 1 for each X that applies to
that R, but that seems even less correct.
I'd also like to use this same construct, whatever it is, to create 1-field
tables to hold enumerated values, so that someone can lookup the name of an
enumeration and have the list of values returned.
Please help set me straight. I am hoping there is a simple way I can do
this without having to use VB, since I don't even understand where the VB
module would go, how to refer to it, how to do the declarations, or any of
that.
I hope this made sense, if not I can explain it more simply.
Thanks in advance!
Lee, San Diego
I have a table containing all things of type X, and another table containing
things of type R. Each R needs to refer to a subset of X, and there are many
Rs and many Xs. For example R1 needs to be associated with X3, X67, X92 and
X99, R5 needs to be associated with X13 and X67, R12 with X2, X3 and X4, and
so on.
My first thought (using generic C language terminology) is to implement this
as an attrribute of R which is a pointer to an array of pointers to specific
Xs. In otehr words, to somehow give R a field called say Xpointer. This
way, using my previous example, For R5 I could give Xpointer a value of
"Xarray5" and have "Xarray5" be a 1 column table (i.e. array)with fields name
Ptr containing values 13 and 67. Then I could create a query that says, in
effect, SELECT * FROM [X] WHERE [Xarray5]![Ptr] = [X]![ID]. I can't figure
out how to do this so that, for many Rs, I can create a single query with a
variable for the pointer array table name, something like "SELECT * FROM [X]
WHERE " & [R]![Xpointer] & " ![Ptr] = [X]![ID]" and have that concatenated
string somehow "be" an SQL statement.
Is there a way to do this? OR am I doing this all wrong? I realized
yesterday there are other ways to do it, such as added lots of columns to
table [X], one for each R, and simply entering a 1 for each X that applies to
that R, but that seems even less correct.
I'd also like to use this same construct, whatever it is, to create 1-field
tables to hold enumerated values, so that someone can lookup the name of an
enumeration and have the list of values returned.
Please help set me straight. I am hoping there is a simple way I can do
this without having to use VB, since I don't even understand where the VB
module would go, how to refer to it, how to do the declarations, or any of
that.
I hope this made sense, if not I can explain it more simply.
Thanks in advance!
Lee, San Diego