Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003

    Unanswered: Printing resets Subform defaults

    Hello all,
    I'm trying to print a form w. subform, but on the DoCmd.Printout all the subform controls display their default values. The screen values remain as they should.

    This occurs for the simplest case possible, a subform w. only a text box on a form w. only a Print button (give it a try!).

    The standard non-answer to this sort of thing is "Print it as a Report, not a Form", but I'd like to understand what's going on here. In my case I have many such forms to print and don't want to have to make reports for each. In the past I've printed many different forms (without subforms) very successfully.

    Any insight is much appreciated!


  2. #2
    Join Date
    Mar 2003
    Southington, CT
    I tried it with just docmd.printout and achieved a result similar to what you described.

    Then I tried using the Command Button Wizard to see what Access created for the same operation (Form Operations category, Print a Form command) and it created the following code which printed my form & subform out perfectly.

        Dim stDocName As String
        Dim MyForm As Form
        stDocName = "myTestForm"
        Set MyForm = Screen.ActiveForm
        DoCmd.SelectObject acForm, stDocName, True
        DoCmd.SelectObject acForm, MyForm.Name, False
    Hope it helps!


Posting Permissions

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