Avatar billede oledr Nybegynder
16. oktober 2002 - 14:09 Der er 7 kommentarer

Navigerbar oversigt

Hej

I forbindelse med en adressedatabase med ca 400 forekomster ønsker jeg at kunne navigere i forekomsterne i en oversigt hvor jeg kan se alle forekomsterne fx. i alfabetisk rækkefølge efter efternavn og samtidig kan springe - fx til bogstavet 'g' nemt. Efterfølgende vil jeg kunne springe til formularen for at ændre i forkomsten.

Årsagen er, at jeg ofte skal tjekke, om de adresser jeg skriver ind i basen står i den i forvejen. Det kan være en smule besværligt pga. små forskellig i stavning af efternavn mv.

venligst,
od
Avatar billede terry Ekspert
16. oktober 2002 - 14:24 #1
This is just a suggestion. You could the tree view control to show all letters of the alphabet and in under each letter youhave the names which start with the letter. Then when you click on the name the information is displaye din a form (maybe a sub form) where you can make your alterations.

Another idea is to have a number of buttons on e for each letter of the alphabet. Then when you click on a button you alter the record source for a form selecting only those which strart with that letter.
Avatar billede oledr Nybegynder
16. oktober 2002 - 14:36 #2
I am not so compentent in using Acces - what is the 'tree view control' or how do I make the bottons for the alphabet?
/od
Avatar billede terry Ekspert
16. oktober 2002 - 15:25 #3
well I hope you can understand this or you have problems.

OK we will try and keep it simple.

make a form using the wizard and choose your tabel containing your adresse data as the record source.

Make this a Continuous Form or a data sheet to show ALL records.
Now add a button to the form header and make the Caption (text) = A
At the same time add another button with the caption B

Now in the on Click event for BOTH buttons add =SelectRecords()
EXACTLY as I wrote "=SelectRecords()"

Now add a text field and name it txtChar, this canbe hidden when it is all working.


Now you need to add this to the forms code


Function SelectRecords()

    On Error Resume Next
    Me.txtChar = Me.Controls(Screen.ActiveControl.Name).Caption
   
    Me.Requery


End Function


Now you need to alter the forms record source to something like this

SELECT *, Format(Left([efternavn ],1),">") AS firstchar
FROM YourTable
WHERE (((Format(Left([efternavn ],1),">"))=[Forms]![TheNameOfTheForm]![txtChar]));


YourTable is the name of the table
TheNameOfTheForm thi sis the name of the form
Avatar billede terry Ekspert
17. oktober 2002 - 08:39 #4
oledr>hows it going here?
Avatar billede terry Ekspert
17. oktober 2002 - 19:34 #5
HeeeeLLLOoooo!
Avatar billede oledr Nybegynder
24. oktober 2002 - 17:02 #6
Hej

Jeg er som sagt ikke så stærk i Access, så jeg roder stadig med dit forslag.

/q
Avatar billede terry Ekspert
08. december 2002 - 12:31 #7
oledr dont you think its about time you closed this question, we cant wait until you learn Access :o)
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