Results 1 to 8 of 8

Thread: [RESOLVED] print button

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    150

    Resolved [RESOLVED] print button

    hi ,

    i have a form that has records like: name, cpr, phone num, description , etc) , i want to put a print button, when i click on the print button i want it to print the current record i stopped at as a report in access, how can i do this?


    Thankx in advance
    Code:
    Private Sub cmdreport_Click()
     'Form5.Show
     'Form3.Hide
    Dim dbName As String
    Dim rptName As String
    Dim Preview As Long
    Const acNormal = 0
    Const acPreview = 2
    dbName = "\\10.70.34.7\it2\PMEW\PROJECTS\Billing System\revenue\rev system\LoginExample\Users.mdb"
    rptName = "viewreport"
    Preview = acPreview 'acNormal
    
    With objAccess
        .OpenCurrentDatabase filepath:=dbName
        If Preview = acPreview Then
           .Visible = True
           .DoCmd.OpenReport rptName, Preview
        Else
           .DoCmd.OpenReport rptName
        End If
    End With
    End Sub
    this code is working, but i want it to print the current record.

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    150

    Re: print button

    Can you give me a sample of the coding please? And will this print the current record?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    150

    Re: print button

    can some one help please, i need it for my project

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    150

    Re: print button

    solved the issue

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: [RESOLVED] print button

    How did you solve the problem?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    150

    Re: [RESOLVED] print button

    i used this code:
    Code:
    Dim strDocName As String
    Dim strWhere As String
        strDocName = "MyReport"
        strWhere = "[serial]=" & Me!txtserial
        DoCmd.OpenReport strDocName, acPreview, , strWhere

  8. #8

Posting Permissions

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



Click Here to Expand Forum to Full Width