Results 1 to 2 of 2

Thread: TabCtl Tab Control on Access form not printing

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Question TabCtl Tab Control on Access form not printing

    In Access 2002 I've just tried placing a simple tab control onto a new form.
    It shows up fine and seems to work as advertised on screen,
    but, the tabctl outline and tab headings don't print.

    Any ideas?
    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: TabCtl Tab Control on Access form not printing

    I don't know if this will work with Access VBA, but it works great with VB. Give it a shot
    vb Code:
    1. Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    2. ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
    3.  
    4. Private Const VK_MENU As Byte = &H12
    5. Private Const VK_SNAPSHOT As Byte = &H2C
    6. Private Const KEYEVENTF_KEYUP = &H2
    7.  
    8. Private Sub cmdPrintForm_Click()
    9. Dim lWidth As Long, lHeight As Long
    10.     Clipboard.Clear
    11.     Call keybd_event(VK_MENU, 0, 0, 0)
    12.     Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
    13.     DoEvents
    14.     Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0)
    15.     Call keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0)
    16.     Printer.Print
    17.     If Width > Printer.ScaleWidth Then
    18.         lWidth = Printer.ScaleWidth
    19.         lHeight = (Printer.ScaleWidth / Width) * Height
    20.     Else
    21.         lWidth = Width
    22.         lHeight = Height
    23.     End If
    24.     Printer.PaintPicture Clipboard.GetData, 0, 0, lWidth, lHeight
    25.     Printer.EndDoc
    26. End Sub

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