Avatar billede martinpoulsen Nybegynder
09. juli 2001 - 14:25 Der er 9 kommentarer og
1 løsning

Udvælgelse af rapport

Kan det lade sig gøre at udvælge en bestemt side i en rapport til udskrift/gennemsyn ved at søge efter indholdet på siden?
Avatar billede terry Ekspert
09. juli 2001 - 14:28 #1
what you could do is set a filter on the report so that you only make a report for the required data.

Avatar billede martinpoulsen Nybegynder
09. juli 2001 - 14:29 #2
how do i do that and can it be done with a macro?
Avatar billede terry Ekspert
09. juli 2001 - 14:32 #3
I NEVER use macro\'s, but in code it looks like this.

DoCmd.OpenReport \"YourReport\", acPreview, , \"User ID = 1\"
Avatar billede martinpoulsen Nybegynder
09. juli 2001 - 14:35 #4
how can i define the page to be shown from a search on eg. a company name?

And what does \"User ID = 1\" mean?
Avatar billede terry Ekspert
09. juli 2001 - 14:37 #5
The \"User ID = 1\" is the same as the WHERE clause in an SQL Query. You can build this in code.
In this example I have a combo where I choose a user and use this in the filter. I could also have other paramaters and use the AND.

Where .... AND .... etc.

MyWhere = \"UserID = \" & Me.cboUserID

DoCmd.OpenReport \"YourReport\", acPreview, , myWhere

Avatar billede terry Ekspert
09. juli 2001 - 14:42 #6
You have a form where you can have a field for each paramaters which you can use for the filter.
Then you can test each field (or combo) to see if something is entered, if so then append this to your where (myWhere).



The userID was just an example, I dont have your database, so have no idea what fields you have....

Avatar billede martinpoulsen Nybegynder
09. juli 2001 - 14:42 #7
when i do this i get a message like this: \"The table \"Virksomhedsdata\" can\'t be locked as it is used by another process\"

What\'s wrong - and how can i help it?
Avatar billede terry Ekspert
09. juli 2001 - 14:51 #8
This should give any problems, opening a report with a filter is a normal thing.

You could send your database to me and I will take a look for you.

If you also tell me what you want to filter on then I will see what I can do!

dkTeBrSa@Europe.LEGO.com



Avatar billede terry Ekspert
12. juli 2001 - 13:13 #9
should= should NOT
Avatar billede terry Ekspert
17. juli 2001 - 09:40 #10
Do you still need help on this question?
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