Discussion:
Access - linking to a look-up table
(demasiado antiguo para responder)
SAEED
2013-09-26 03:57:15 UTC
Permalink
I have a field in a table and it is set to a number
I have created another table (Lookup via wizard)

1 String
2 Char
3 blaa blaa


and have managed to link that field to this table
so if the user wants to choose 3 he/she knows what 3 is

Question is how do i do this via " sql command "to modify my table
so my field is no longer independant but it is linked up to a my look up table


Cheers
SAEED
2013-09-26 05:59:06 UTC
Permalink
Post by SAEED
I have a field in a table and it is set to a number
I have created another table (Lookup via wizard)
1 String
2 Char
3 blaa blaa
and have managed to link that field to this table
so if the user wants to choose 3 he/she knows what 3 is
Question is how do i do this via " sql command "to modify my table
so my field is no longer independant but it is linked up to a my look up table
Cheers
In case you want to know teh solution then try


CREATE TABLE LookupParam ([Field1] NUMBER NOT NULL ,[Field2] VARCHAR(40) NOT NULL);
INSERT INTO LookupParam (Field1,Field2) VALUES ( 1,'String');
INSERT INTO LookupParam (Field1,Field2) VALUES ( 2,'Global');
INSERT INTO LookupParam (Field1,Field2) VALUES ( 3,'Literal');
INSERT INTO LookupParam (Field1,Field2) VALUES ( 4,'Who knows');
UPDATE Parameter SET ParameterType = L.Field1 FROM Parameter S join LookupParam L on S.key = L.key;

embed all this in your code after opening the table and closing it at the end
Loading...