Avatar billede tma_oksboel Nybegynder
05. november 2002 - 16:50 Der er 6 kommentarer og
1 løsning

Antallet af poster i en rapport

Hej

Hvordan aflæser jeg antallet af poster i en rapport der modtager 2 datoparametre. Skal kunne aflæses kodemæssigt.

Torben
Avatar billede terry Ekspert
05. november 2002 - 17:21 #1
You MAY be able to do it by using the dcount function.
Is it the query which needs th etwo parameters? What you could do is open the report via a form and when opening the report use the WHERE paramater of the docmd.openreport instead of the two paramters. Then in your report you use Dcount to count how many records there are, obviosuly using the same WHERE clause. Hope that makes sence!
Avatar billede terry Ekspert
05. november 2002 - 17:43 #2
You MAY be able to do it by using the dcount function.
Is it the query which needs th etwo parameters? What you could do is open the report via a form and when opening the report use the WHERE paramater of the docmd.openreport instead of the two paramters. Then in your report you use Dcount to count how many records there are, obviosuly using the same WHERE clause. Hope that makes sence!
Avatar billede terry Ekspert
05. november 2002 - 17:44 #3
Think eksperten is having problems updating here!
Avatar billede tma_oksboel Nybegynder
05. november 2002 - 17:50 #4
I'll try it later on this evening.

Torben
Avatar billede terry Ekspert
06. november 2002 - 09:55 #5
Hi Torben, did you look at it?
Avatar billede tma_oksboel Nybegynder
06. november 2002 - 10:01 #6
Hi Terry,

Just finished it now. It works all right, but I think it is strange that is isnt possible at the report alone. The report was to be printed out from the switchboard directly, and the recordcount should be in the header.
I tried to open the recordset at the report, but at report_open then report wasnt finished loading. I could use report_activate, but then the user had to manually activate the form.
As i mentioned, i changed the structure so that I start the report from a form, and it works, so points to you, Terry.

Thanks
Avatar billede terry Ekspert
06. november 2002 - 10:28 #7
It maybe is but you say that the query takes two parameters, and we obvioulsy need these two paramaters when we use DCount otherwise we wont get the same number of records.
Anyway its working now and that what counts.

Tanhks for the points 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