27. maj 2006 - 10:39Der er
14 kommentarer og 1 løsning
Antal resultater
Hej Eksperter Jeg har en form, som henter sine resultater fra en Query. Der er i formen en bladrefunktion og jeg vil gerne kunne vise noget i stil med "Resultat 1 ud af 40". Hvordan kan jeg lave dette?
I have a form where i want to show the results of a query. But it would be nice if the user knew how many results there were. On the form there are two buttons - a next and a previous button. Between these i would like it to show where the user is.
If i right click the textbox, the only way i seem to be able to write in the code, is if i choose "Build Event". If i do this the code will look like this: Option Compare Database
Private Sub Text15_BeforeUpdate(Cancel As Integer) Me.Text15 = "Resultat " & Me.Recordset.AbsolutePosition + 1 & " ud af " & Me.Recordset.RecordCount
Normally you can see that if you use Access's built in navigation buttons. If you dont use that then you can use some code similar to what I have given and place it in the On Current event. Have you tried the example I gave?
Sorry - i see the mistake i made now. It works now! Thank you very much.
By the way. Can you tell me how to fix my next and previous button, so that they dont "go to far"? Right now i get an error when there is no more results from the query.
Thank you very much - I will try that. I just noticed that when i enter the form it says Resultat 1 ud af 1 even though the is 3. When i hit the next button is changes to the right number.
No idea as to why it shows Resultat 1 ud af 1. I have an example here and it works as expected. I'll take a look at your dB if you like, maybe I can see the problem?
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.