16. november 2004 - 19:56Der er
9 kommentarer og 1 løsning
Rapport og nummering1
Hej
I en Access db har jeg lavet en foresprøgsel. Denne forespørgsel indeholder en række felter, bla. kundenummer. Til hvert kundenummer, knytter sig 5-10 rækker i forespørgselen.
Spørgsmålet er nu: Kan jeg få access til at skrive nummer 1/5 i den første række, nummer 2/5 i den anden, nummer 3/5... Og hvis der f.eks. knytter sig 10 rækker til et kundenummer, skal den naturligvis skrive 1/10, 2/10 osv.
Formen behøver ikke at være lige sådan, men må også gerne være to kolonner, en med det samlet antal rækker og en med denne kundes række nummer?
Denne side indeholder artikler med forskellige perspektiver på Identity & Access Management i private og offentlige organisationer. Artiklerne behandler aktuelle IAM-emner og leveres af producenter, rådgivere og implementeringspartnere.
I think you will need to make a function To do this. Then you have three variables at the top of the forms module, so that they are static . One for holding the Kundenummer, one for holding the row number (1....10) and another for holding the number of rows for that kunde.
You will need to call the function with one (I think) paramater, the kundenummer. Then test to see if the kundenummer you send to the function is the same as the one in the static variable. If it is NOT the same then you need to use for example DCount() to get the number of records for this kunde and put it in the variable. You could make a copy of the forms recordset and loop through that counting them too.
So now you have the max rows for that kunde, and you still need the row number. At the same time as you test that the kundenummer you come with is NOT the same as the static variable, then you set the variable containing the row to 0. Then you just add one to it for each row.
Then its just a case of returning these values in a string EXAMPLE: GetKundeRowNum = iRow & "/" & iMaxRow In the function you will need to test if the
Oh, forgot to mention! On the form you have an unbound field where the control source is set to call the function
=GetKundeRowNum([Kundenummer])
Synes godt om
Slettet bruger
22. november 2004 - 23:26#7
Hej Da jeg ikke får tid til at kigge mere på det lige nu, vil det så være mest rimligt at du får point nu, og så må jeg spørge igen, hvis jeg løber ind i problemer?
Well I prefer closing the question as soon as possible, but I'm sure if you look at my karam that others have a different opinion :o) If you think you have received help which justifies giving the points then I think you should close, if not then let it stay open until you do.
From my experience this isnt a quextion which has a streighforward answer, otherwise I would have given it. There are a number of problems involved in finding a workable solution, and thats why I just gave an idea as to how it might be done, although no guaranties. So in the end it may take hours to get it working correctly!
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.