in the printing of the access form get error dialog box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nuwan1988
    New Member
    • Apr 2014
    • 3

    in the printing of the access form get error dialog box

    in the printing of the access form using following cord.. get error........

    Code:
    Private Sub CommandBtn_Click()
    Dim MyForm As Form
    Set MyForm = Screen.ActiveForm
    DoCmd.SelectObject acForm, MyForm.Name, True
    DoCmd.PrintOut
    DoCmd.SelectObject acForm, MyForm.Name, False 
    End Sub

    the error is...
    ''the object you referenced in the visual basic procedure as an OLE object isn't an OLE object''

    error number- 2950

    please give me the solutions.....
    Last edited by Rabbit; Apr 25 '14, 05:30 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    - Version of access?
    - See here: > Before Posting (VBA or SQL) Code set the options and debug/compile (repeating after each fix)
    - Insert STOP in-between lines 2 and 3 as formatted in the post.
    - Run your code
    - When you enter break mode at the STOP, use [F8] to step thru the code.
    - When you reach the error line: Please post, the numbr of line the error occures and the EXACT title, number, and text of the error message. Please do not alter, omit, nor abbreviate the information provided in the error message

    Comment

    Working...