Results 1 to 3 of 3
  1. #1
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21

    Report Search is going straight to PRINT instead of Report View

    Hello,

    I have created a form for search for users information and display the information in a report. I have used to following code to search for specific users:

    Private Sub Find_Pupil_Click()
    Dim sSurname As String
    Dim sRegClass As String



    sSurname = Me.txtSurname
    sRegClass = Me.txtRegClass

    If DCount("*", "T_Pupil_Information", "Surname = '" & sSurname & "' And RegistrationClass = '" & sRegClass & "'") = 0 Then
    MsgBox "Incorrect User Details! Please re-enter your details", vbExclamation, ""

    Else

    DoCmd.OpenReport "R_Pupil_Evidence", acViewNormal
    End If
    End Sub

    When a users enters a Surname and Registration Class into the unbounded text boxes (Surname and RegistrationClass) and a user is found, I want their details to be presented in the Report (R_Pupil_Evidence) I have created. However, when searching for a user at present, the report is automatically going to print and not to Report View.

    Can anyone help me with this????


    Regards




    Macftm

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Try replacing acViewNormal with acViewPreview in your DoCmd... line.

  3. #3
    macftm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    21
    Orange, thank you so much. That has worked!!! Much appreciated.


    Regards

    Macftm

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

Similar Threads

  1. Replies: 1
    Last Post: 03-26-2012, 03:01 PM
  2. Report Won't Print
    By Two Gun in forum Reports
    Replies: 7
    Last Post: 10-04-2011, 05:19 AM
  3. Print a report without saving it
    By maladoi in forum Reports
    Replies: 2
    Last Post: 08-18-2011, 12:07 PM
  4. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  5. Replies: 0
    Last Post: 02-22-2011, 05:04 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