Results 1 to 3 of 3
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Docmd Method With If Loop

    Hi

    Code:
     IF(DoCmd.OpenReport "User_Details", acViewNormal) Then
    MsgBox "Report Printed Successfully"
    Else
    MsgBox "Report Not Printed"



    is this above code correct? if not what changes to be done?

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    If a report won't print you'll get an error, use this to tell your user there was a problem.
    It won't tell you it has printed correctly as far as I'm aware.

    There is a discussion here that might help https://access-programmers.co.uk/for...d.php?t=204812
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hey Minty

    Awesome, that worked. Thanks alot mate.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-26-2017, 08:14 AM
  2. DoCmd.SendObject Method (Access)
    By adnancanada in forum Import/Export Data
    Replies: 7
    Last Post: 06-08-2017, 01:35 PM
  3. Replies: 6
    Last Post: 06-25-2016, 02:56 PM
  4. Replies: 11
    Last Post: 03-02-2016, 11:01 AM
  5. Replies: 5
    Last Post: 09-05-2014, 12:06 PM

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