J
jy836
Hey again. Thank you to everyone who responded to my question in the "Newbie
database question" thread. I've got a new problem, though. ;-)
I linked to an Access 2000 database. This database has a master table and
several other tables. For the sake of simplicity, I'll just call the Master
table "Master" and the other table I'm working with "Table2." I created two
OleDbDataAdapters (one for Master, and one for Table2). I am trying to make
it possible to type a person's last name into a text box, and have my
application search the Master table for the last name (in a field called
"nameLast"). Then it will retrieve the ID of that person (in a field titled
"ID"--there is a field of the same name in Table2). Once this is done, I
want to automatically display (in a DataGrid) the contents of all rows in
Table2 which have the same ID as the one in Master. But I'm having troubles
creating the relation between Master and Table2.
In the Edit Relation window, I selected "Master" as the parent element, and
"Table2" as the child element. The problem I'm having is determing what
values to set to the key, key fields, and foreign key fields. I tried to set
the key field and foreign key field to "ID," but although the ID seems to be
retrieved without problem from the Master table, I can't seem to complete
the relation to Table2 to display the information in the DataGrid. (I have
already set the properties of the DataGrid to their appropriate values.)
Also, I'm unsure of what the "Key:" text box (the one directly under the
"Parent element:" text box in the Edit Relation window) is for. Could
someone please help? Hope this makes sense. Thanks...
Jay
database question" thread. I've got a new problem, though. ;-)
I linked to an Access 2000 database. This database has a master table and
several other tables. For the sake of simplicity, I'll just call the Master
table "Master" and the other table I'm working with "Table2." I created two
OleDbDataAdapters (one for Master, and one for Table2). I am trying to make
it possible to type a person's last name into a text box, and have my
application search the Master table for the last name (in a field called
"nameLast"). Then it will retrieve the ID of that person (in a field titled
"ID"--there is a field of the same name in Table2). Once this is done, I
want to automatically display (in a DataGrid) the contents of all rows in
Table2 which have the same ID as the one in Master. But I'm having troubles
creating the relation between Master and Table2.
In the Edit Relation window, I selected "Master" as the parent element, and
"Table2" as the child element. The problem I'm having is determing what
values to set to the key, key fields, and foreign key fields. I tried to set
the key field and foreign key field to "ID," but although the ID seems to be
retrieved without problem from the Master table, I can't seem to complete
the relation to Table2 to display the information in the DataGrid. (I have
already set the properties of the DataGrid to their appropriate values.)
Also, I'm unsure of what the "Key:" text box (the one directly under the
"Parent element:" text box in the Edit Relation window) is for. Could
someone please help? Hope this makes sense. Thanks...
Jay