Page 3 of 3 FirstFirst 123
Results 31 to 38 of 38
  1. #31
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402

    Cool An Answer & Solution for you

    Hi I have had time to investigate this now and come to the conclusion that it cannot be done the way you are trying.

    What I have done is tried all of what you have and it wont work like that.

    So I have tried to do this another way, 2 buttons on form 2 lines of code each -


    What this does is open the form in print preview and then opens the page setup dialog options to adjust margins, size...
    OR opens the form in print preview and then opens the print dilalog options to adjust copies, orientation...

    Print Preview, with Page Setup dialog open
    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' opens form in print preview mode
    DoCmd.DoMenuItem acFormBar, 0, 7, , acMenuVer70 ' opens page seup options dialog
    OR
    Print Preview, with Print dialog open
    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' Open form in print preview mode
    DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70 ' Open print dialog options dialog

    You can't do both at the same time!
    OK. it seems you can...!!!!!!!!!!!
    this opens the form in print preview, and shows the page setup options, when you close the page setup options dialog you then see the print dialog. it's one way anyway

    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' opens form in print preview mode
    DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70 ' Open print dialog options dialog
    DoCmd.DoMenuItem acFormBar, 0, 7, , acMenuVer70 ' opens page setup options dialog




    Last edited by pbaldy; 03-15-2014 at 10:36 AM. Reason: Deleted attachment per OP request

  2. #32
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Thanks Trevor40. I'm sure your solution is as good as it gets. I just find it odd that microsoft would not look into this issue since they are the ones who provide the setup button to show up and then not make available based on even my most stripped down database. I seriously just created a brand spanking new database just to make those 2 print buttons and they still didn't work. So I guess this thread will finally come to an end. Although it was not the answer I had hoped for, it will have to to. I want to thank all who put the effort forth to try and figure this out. This drove me nuts for a while but I think I can live without it. Its time to move on. Thanks again.

  3. #33
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    OK. it seems you can...!!!!!!!!!!!
    this opens the form in print preview, and shows the page setup options, when you close the page setup options dialog you then see the print dialog. it's one way anyway

    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' opens form in print preview mode
    DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70 ' Open print dialog options dialog
    DoCmd.DoMenuItem acFormBar, 0, 7, , acMenuVer70 ' opens page setup options dialog


  4. #34
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    Well here ya go, this does it for you !!!!!!!!!!!!!!!!!!!!!!!!!!
    Private Sub Command1345_Click()
    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' opens form in print preview mode
    DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70 ' Open print dialog
    DoCmd.DoMenuItem acFormBar, 0, 7, , acMenuVer70 ' opens page setup options dialog
    DoCmd.DoMenuItem acFormBar, 0, 7, , acMenuVer70 ' closes page setup and just leaves print dialog open, and then you CAN click print setup
    ' you don't see the page setup until you click on the button! it opens and closes.
    End Sub

  5. #35
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Sorry trevor40,

    I just tested your code with a brand new db. I get this error:

    Run-Time error '3270':
    Property Not Found

    So I click on Debug and it points to this line:
    DoCmd.DoMenuItem acFormBar, 0, 8, , acMenuVer70 ' opens form in print preview mode

    This was done while running in POP UP and MODAL. So then I tried turning those off. And this is what happens.

    I click the Print button and it changes to print preview mode. Then I click on setup in the dialogue window and I get the classic error message that started this whole thread in the first place. (This action can't be carried out...........blah blah blah) I click OK then close the dialogue window then the debug window comes up with:

    Run-time error '2501':
    The DoMenuItem action was canceled.

    And it points to this line when I click Debug:
    DoCmd.DoMenuItem acFormBar, 0, 9, , acMenuVer70 ' Open print dialog

    We should really just drop this issue already. Haha its worthless and pointless. But by the sound of it, it seems you got this to work so thats good. Right now I am on a 4th different copy of MS Office and am still getting this problem so I'm pretty sure my bad copy theory is not holding up as a possibility unless I just so happen to try it on a bad batch of MS Office copies from the factory which is pretty much impossible. Like I said before, its ok, I will accept that there is no fix and I will work around this problem the best way I can.

  6. #36
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,962
    It's not your copy of MS Office. I already noted in post 24 that I get the same error.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #37
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402

    Cool This has a mind of it's own

    This has a mind of it's own. Works then doesn't, I tried this just now and it works fine, test the attached file if it works for you, import you db into and then try again.

    db1 test.mdb

  8. #38
    data808 is offline Noob
    Windows 7 32bit Access 2007
    Join Date
    Aug 2012
    Posts
    727
    Maybe its your file extension of .mdb

    Isn't this an old format that is no longer supported by 2013 Office? I don't have my computer with Access right now so I will have to wait and test it when I get home. But right now I am working with .accdb file extensions so I wonder if .mdb is the culprit?

    While we are on the subject, I found out that 2013 Office also does not have the converting feature to change the file extension from .accdb to .accde anymore. Unless I am missing something it seems that .accde is also a dieing format.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-10-2013, 11:21 AM
  2. Triggering a form event from a report
    By Paul H in forum Forms
    Replies: 2
    Last Post: 10-12-2012, 09:48 AM
  3. Carried over totals
    By Alex Motilal in forum Reports
    Replies: 0
    Last Post: 10-06-2010, 08:28 AM
  4. Carried over totals
    By Alex Motilal in forum Reports
    Replies: 3
    Last Post: 01-29-2010, 11:13 AM
  5. New Database - Batch processing
    By stevo2820 in forum Database Design
    Replies: 0
    Last Post: 04-30-2007, 02:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums