Results 1 to 2 of 2
  1. #1
    Halocarbon Guest

    hiding forms


    I am making a database in which my users will add data to a form then they
    will click a command button that runs a macro to view the information on a
    report. How can I get the form to hide while they are viewing the report. I
    did this in Access 97 with the send keys function and using "%W"h, then
    opening the report. But in Access 2000 this does not work. Any ideas? I have
    sort of fixed it by having two separate send keys functions; one to press %,
    and the other to press wh. But sometimes this works and sometimes it doesn't.
    Anyone know why?

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275

    Re: hiding forms

    Quote Originally Posted by Halocarbon
    I am making a database in which my users will add data to a form then they
    will click a command button that runs a macro to view the information on a
    report. How can I get the form to hide while they are viewing the report. I
    did this in Access 97 with the send keys function and using "%W"h, then
    opening the report. But in Access 2000 this does not work. Any ideas? I have
    sort of fixed it by having two separate send keys functions; one to press %,
    and the other to press wh. But sometimes this works and sometimes it doesn't.
    Anyone know why?
    Try this, updating as needed to fit your object names. The code goes in the code module for the report.

    Code:
    Private Sub Report_Close()
    
        Dim frm As Form
        
        On Error Resume Next
        Set frm = Forms("frmReports")
        If Err = 0 Then frm.Visible = True
        On Error GoTo 0
    
    End Sub
    
    Private Sub Report_Open(Cancel As Integer)
    
        Dim frm As Form
        
        On Error Resume Next
        Set frm = Forms("frmReports")
        If Err = 0 Then frm.Visible = False
        On Error GoTo 0
        
    End Sub

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

Similar Threads

  1. Hiding subreports
    By aouellette in forum Reports
    Replies: 0
    Last Post: 09-12-2008, 08:02 AM
  2. Replies: 1
    Last Post: 10-26-2007, 07:29 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