Avatar billede tipsen Nybegynder
25. marts 2004 - 17:57 Der er 10 kommentarer og
2 løsninger

Efterligne HTML drop-down boks i Access formular

Hej eksperter

Hvordan kan jeg i Access efterligne nedenstående drop-down boks, som er lavet i html?

<select name="varnavn" size=1>
  <option value="key1">val1
  <option value="key2">val2
  <option value="key3">val3
</select>

Det essentielle er, at val1-val3 er de værdier som brugeren skal vælge mellem, mens key1-key3 er de værdier som der skal arbejdes med bagved skidtet! Jeg går udfra det må kunne lade sig gøre med enten en combo-boks eller en list-boks?

På forhånd tak.

Mvh Tommy
Avatar billede terry Ekspert
25. marts 2004 - 19:13 #1
Well I dont konw much about HTML but in Access you can use a List of Values in the Row Source.
It would look something like this

Row Source Type = "ValueList"

Row Source = Key1;"val1";"key2";"val2";"key3";"val3"

Column count = 2
Avatar billede terry Ekspert
25. marts 2004 - 19:15 #2
Looking at you rquestion again, you should maybe change KeyX;ValX around so that valXis in the first column and then have column 1 as the ound colun
Avatar billede terry Ekspert
28. marts 2004 - 13:09 #3
?
Avatar billede tipsen Nybegynder
29. marts 2004 - 16:59 #4
OK - Har fået det til at virke *næsten* som jeg vil have det - jeg vil gerne have, at boksen opfører sig præcis som en HTML drop-down boks - den (combo-) boks jeg har lavet nu giver mulighed for at brugeren kan indtaste tekst i selve boksen (godt nok SKAL teksten matche en af valgmulighederne) - brugeren skal ikke have mulighed for at indtaste en valgmulighed - er det muligt at lave?
Avatar billede terry Ekspert
29. marts 2004 - 17:15 #5
set the combo's Limit to List property to Yes!
Avatar billede tipsen Nybegynder
29. marts 2004 - 18:14 #6
Det har jeg gjort - hvilket medfører at der kun accepteres indtastninger, som er identiske med allerede eksisterende liste elementer - men det er stadig muligt, at indtaste et valg, hvilket er lidt håbløst når elementerne består af 15-25 tegn :-/
Avatar billede terry Ekspert
29. marts 2004 - 18:23 #7
tipsen I know almost nothing about HTML so I can not comment on how drop-downs work there, but in Access you have to enter something in the field before it can find it in the drop down.
You can use

YourCombo.dropdown to open the lisyt while the user is entering data
Avatar billede tipsen Nybegynder
29. marts 2004 - 18:32 #8
terry: Du behøver ikke kende til HTML for at vide, hvordan en drop-down fungerer - det er et standard form element på en webside - det fungerer på samme måde som en drop-down menu i Access bortset fra, at man ikke kan indtaste noget i feltet, men udelukkende vælge mellem de angivne liste elementer (options)
Avatar billede terry Ekspert
29. marts 2004 - 19:08 #9
tipsen>If I dont know how a drop-down in HTML works then it isnt easy for me to get Access's combo to work the same!

It may be possible to stop the user from entering data directly into the field butthis would need to be done in code. Then the user would still need to user the up/down keys to select from the list.
So, without a bit of work I would say that you arent going to get much closer
Avatar billede tipsen Nybegynder
29. marts 2004 - 20:20 #10
terry: I find it strange if you've never seen a drop-down box on a web page - for instance you can find three of them on the main page of http://tv2.dk in the (almost) upper left corner of the page - that's it - nothing fancy :-)

It's annoying that's it's not easy to accomplish but I'll leave it for now - thanks for all your help!
Avatar billede terry Ekspert
29. marts 2004 - 21:13 #11
I'm not saying I have never seen a drop-down on a web page, I am saying that I know very little about HTML or drop-downs on web pages as regards to how they work. I have no idea if it is possible to change the functionality of web drop-downs to work as they do in Access, therefore I cant give you what I dont know :o)

but thanks anyway!
Avatar billede tipsen Nybegynder
29. marts 2004 - 22:25 #12
Ahh - I think we misunderstood each other then - I wanted to modify the Access drop-down boxes to work exactly like ordinary web drop-down boxes - and they all work the same way - but apparently the boxes in Access forms can't be modified to "copy" the wanted behaviour!
Avatar billede Ny bruger Nybegynder

Din løsning...

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.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester