In the table where you want to see a listbox (combo) then you change the field type to a lookup. When you change the type you will see lookup. This will start a wizard. Follow th ewizard and if your table relationshipd are OK it will (or should) make a list for you
Da jeg senere skal bruge det til ASP, så vil jeg have det så vælger navnet, men den skriver id altså et tal men den viser navnet, hvis du forstår hvad jeg mener.
eks: jeg har listboxen, den viser f.eks. Erhvervs kunde, men den har value der hedder 1 osv.
Det er simpelt at lave det på en asp side, men vil gerne have det i databasen.
Du behøver heller ikke vide noget om ASP, jeg vil bare mene at man kan lave en listbox hvor punkterne har et navn fra en kolone og en værdi fra en anden.
if this is to be used in ASP then NONE of these answers will work. If you also want to be able to open Access and look directly into a table then try my answer I gave 17/03-2003 18:42:28
In ASP you CAN NOT see any Access forms or objects it is onlt the tables(data) you can use from Access.
Terry I am building up a large database, and I want all the info in the database before moving on to the ASP coding.
I was just using the ASP as an example, because in ASP you can have a dropdown box a give a name and a value.
The main problem is, that if I use your method I will get the names from one table into another, but if I change the name in table1 then I have to change all the names manually in table2.
I hope you understand what I mean, it its a little complicated to explain in a forren language.
If you normalize your database correctly then table one will have a foreign key referencing a record in table two. If you alter the name in table two then the primary key in table two which is the foreign key in table one will be the same. So even though you have altered the name in table two this name will be the one table one references.
Example:
tblOne ID (primary key) 1 Txt (some text field) "Hej Med Dig" FID (foreign key) 1 > references ID in tblTwo
tblTwo ID (primary key) 1 YourName "sofus"
So at the moment tblOne is related to tblTwo and the name is "sofus"
If you now alter "sofus" to "terry" then tblOne will STILL be related to tblTwo but now have the name = "terry"
So you dont have to change anything, or am I missing something?
Yes I know that, but when you need to write a lot of data into you database, It would be alot faster to have a dropdownbox in table one where you could chose "YourName" and if I Chose "Sofus" then it would type FID "1" in tblone.
sofus> IF you use the method I have mentioned 17/03-2003 18:42:28 then this is EXACTLY what it does (and if I Chose "Sofus" then it would type FID "1" in tblone.) The combo shows "sofus" but it PUTS 1 in tblOne
Sofus -> i tblone - designvisning - fid i bunden er der to fane blade den sidste 'opslag' her vælger du 'Kombinationsboks' under rækkekilde skriver/vælger du tbltwo antal kolonner sættes = 2 kollone bredde sættes = 0;2 (derved skjules ID kollonen fra tbltwo)
Kan du prøve at ændre databasen, så jeg kan i table1 vælge "yourname" og få den til at skrive "id"
Altså så det er værdien "yourname" man vælger men det skriver værdien "id" i tabel1 ? da det er en del lettere at huske navne end tal hvis der kommer mange ?
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.