Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    33

    Unanswered: Why is Access opening my report *behind* my forms?

    I have a basic form and a basic report. On my form I have two text boxs for a date range (a start date and an end date) and a button. When the button is pressed the report is opened (through some simple Visual Basic). However, when the report is opened, it's placed BEHIND all of the on-screen forms and the only way to get to it is to MOVE the form windows around...

    Here is the code that opens the report:
    Code:
    Private Sub Command0_Click()
    On Error GoTo Err_Command0_Click
    
        Dim stDocName As String
        Dim strWhere As String
        
        strWhere = strWhere & " AND satDown=true "
        
        If Len(Me.fromDate & "") > 0 And Len(Me.toDate & "") > 0 Then
            strWhere = strWhere & " AND dateofreferral Between #" & CDate(Me.fromDate) & "# AND #" & CDate(Me.toDate) & "#"
        Else
            strWhere = strWhere & " AND dateofreferral Between #" & Date & "# AND #" & Date & "#"
        End If
    
        stDocName = "Sits Report"
    
        If Len(strWhere & "") = 0 Then
            DoCmd.OpenReport stDocName, acViewPreview
        Else
            DoCmd.OpenReport stDocName, acViewPreview, WhereCondition:=Mid(strWhere, 6)
        End If
    
    
    Exit_Command0_Click:
        Exit Sub
    
    Err_Command0_Click:
        MsgBox Err.Description
        Resume Exit_Command0_Click
        
    End Sub
    Can anybody please help me?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    It has nothing to do with the code that opens your report, but is probably due to the "Pop Up" and "Modal" properties of your forms (check the "Other" tab in the properties box...).
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Oct 2003
    Posts
    33
    To be honest, I'm a software developer but I use Delphi (for web-apps only [stand-alone CGI .exes]) and MS SQL, so I'm not too familiar with MS Access.

    I designed this simple database for my father about a year ago so I completely forget why I did what I did... (of course, it could be that I didn't know what I was doing...)

    Currently the main form in the database is set to "Pop-Up: Yes" and "Modal: No". I'm not sure why I did this, but I have Access set open my main form whenever the database is opened and I have all of the other controls hidden... (so my father can't accidentily "redesign" any forms or anything like that).

    Should I change the Pop-Up and Modal settings to something else? What about the other forms? (on my main form I have buttons that open the other, smaller, forms)

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You can change the Pop-Up to "No", but that will change the way the form interacts with the desktop and with other forms.

    Basically, you have to live with the report previews being behind your form, or live with your form not always being on top of other forms. You can't set it to be "on top of all other forms, but beneath print preview windows".
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    also you could make your reports pop-up too.
    ghozy.

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    D'oh!

    I never noticed that! That is definitely the way to go...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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