Results 1 to 4 of 4

Thread: Help!

  1. #1
    Join Date
    Feb 2004
    Location
    Newbury, UK
    Posts
    7

    Cool Unanswered: Help!

    Hello All,

    I am trying to do the following, and failing badly!

    I have a combo box, which contains the following values: Active, Withdrawn, Completed and Non-Starter.

    When the user selects something other than Active, I would like a message box to appear, asking if they would like to print a specific report. If they click yes, then the report is displayed in Print Preview, if No, then the message box simply goes away.

    Any Ideas?

    Cheers
    Martyn

  2. #2
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    You will need to write some code for the After Update event of the combo box. The code eould look like this, assuming that the combo box is called "CmbStatus".

    Sub CmbStatus_AfterUpdate()

    Select Case CmbStatus

    Case <> "Active"

    Select Case Msgbox( "Print Report Now ?",vbQuestion+vbYesNo,"Print Report")

    Case vbYes

    DoCmd.OpenReport "MyReport",acViewPreview
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  3. #3
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    You will need to write some code for the After Update event of the combo box. The code eould look like this, assuming that the combo box is called "CmbStatus".

    Sub CmbStatus_AfterUpdate()

    Select Case CmbStatus

    Case <> "Active"

    Select Case Msgbox( "Print Report Now ?",vbQuestion+vbYesNo,"Print Report")

    Case vbYes

    DoCmd.OpenReport "MyReport",acViewPreview

    End Select

    End Select

    Hope this helps. If you need the user to be able to print a different report for each selection, that's a bit more complicated...but quite straightforward.
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  4. #4
    Join Date
    Feb 2004
    Location
    Newbury, UK
    Posts
    7

    Thanks

    That works great... Many Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •