Avatar billede n_riber Nybegynder
24. april 2001 - 17:49 Der er 14 kommentarer og
1 løsning

VBA Programmering

Jeg vil gerne tilføje en knap på formularen \"popup uge-dag\", hvor brugerene kan annullere udskrivningen af \"teovand1\"

DoCmd.OpenForm \"popup uge-dag\", acNormal, \"\", \"\", acEdit, acDialog
DoCmd.OpenReport \"teovand1\", acNormal, \"\", \"\"
DoCmd.Close acForm, \"popup uge dag\"
DoCmd.OpenForm \"Hovedmenu\", acNormal

Det skal med ind under nedenstående knap og de to hændelser som er der i forven skal også virke
Private Sub annuller_Click()
DoCmd.Close
DoCmd.OpenForm \"hovedmenu\", acNormal


Hvordan gør jeg ?

/niels
Avatar billede n_riber Nybegynder
24. april 2001 - 17:50 #1
forven = forvejen
Avatar billede mugs Novice
24. april 2001 - 21:27 #2
Er annulleringen af udskrivningen knyttet til en betingelse?

Hvis den ikke er,kan du vel blot udskrive din rapport til skærm (DoCmd.OpenReport \"RAPPORTNAVN\", acPreview, \"\", \"\"), så brugerne kan gennemse rapporten og dermed være sikker på at det virkelig er det der skal udskrives.

Hvis udskrivningen er knyttet til en betingelse kan du benytte en If...Then... sætning, hvis betingelsen ikke er opfyldt og rapporten dermed ikke skal udskrives benytter du kommandoen:

DoCmd.CancelEvent


Mvh / Mugs
Avatar billede terry Ekspert
25. april 2001 - 13:48 #3
Re-design your program!
Why print a report if it isnt necessary?
Avatar billede n_riber Nybegynder
25. april 2001 - 14:46 #4
brugeren skal have muliged for at anullere udskiften
/niels
Avatar billede n_riber Nybegynder
25. april 2001 - 15:28 #5
anullere = annullere
Avatar billede terry Ekspert
25. april 2001 - 15:41 #6
When the report is printing doesnt the user get a standard dialog up where he can select cancel?
Avatar billede n_riber Nybegynder
25. april 2001 - 15:42 #7
only for about 1 or 2 sec.

/niels
Avatar billede terry Ekspert
25. april 2001 - 15:45 #8
So I doubt you can cancel the report from Access. All pagaes will have been formatted and sent to the print q.
Avatar billede n_riber Nybegynder
25. april 2001 - 15:48 #9
i have a popup where the user, select start-date and end-date, and the click ok or cancel, but my cancel doesn\'t work correct.

/niels
Avatar billede terry Ekspert
26. april 2001 - 08:09 #10
If I understand you correctly, if the user selects OK then the reports gets printed. If the user decides not to print he presses the Cancel, which closes the form without printing, but you say doesnt work correct.
Remove the cancel button and then add a new one using the Command Button Wizard. You will need to add the line which opens your other form.
Avatar billede terry Ekspert
26. april 2001 - 08:09 #11
The comment was my answer...
Avatar billede n_riber Nybegynder
26. april 2001 - 09:11 #12
that won\'t do it because access then creates small popups asking for my parameters, what i need is some sort of argument that cancels printing the report
Avatar billede terry Ekspert
26. april 2001 - 09:30 #13
Niels, I am sorry to say that I still suggest that you redesign your program. If I do hit on something I will get back to you.

terry
Avatar billede n_riber Nybegynder
26. april 2001 - 09:38 #14
i think I\'ve got the solution alredy, quite simple really, instead of the current position of the docmd.openreport, i place it under my printbutton on the popup.
In other words a redesign.

Avatar billede terry Ekspert
26. april 2001 - 09:41 #15
Thanks Niels!
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