Results 1 to 4 of 4
  1. #1
    Patience is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    52

    Open report if checkbox is ticked


    Hi,

    I have this code:

    Code:
    Private Sub Kommandoknap749_Click()
    On Error GoTo Err_Kommandoknap749_Click
        Dim stDocName As String
        stDocName = "Abrasion internal"
        DoCmd.OpenReport stDocName, acPreview
        stDocName = "Fire tests"
        DoCmd.OpenReport stDocName, acPreview
    
    Exit_Kommandoknap749_Click:
        Exit Sub
    Err_Kommandoknap749_Click:
        MsgBox Err.Description
        Resume Exit_Kommandoknap749_Click
        
    End Sub
    How do I specify that the report "Abrasion internal" must only open if CheckBox A is ticked?

    Thank you very much!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Wrap that one in an If/Then block:

    If Forms!FormName.CheckBoxA = True Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Patience is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    52
    It works perfect!

    Thank you a lot

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Report won't open
    By okakopa in forum Reports
    Replies: 1
    Last Post: 05-24-2010, 04:09 AM
  2. Open Report or Form depending on condition
    By jheintz57 in forum Forms
    Replies: 5
    Last Post: 03-12-2010, 08:16 PM
  3. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  4. Replies: 3
    Last Post: 01-14-2010, 08:32 AM
  5. open report from a vb form
    By tracamonali in forum Reports
    Replies: 2
    Last Post: 08-10-2009, 01:55 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