Get access not to print background color of Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emandel
    New Member
    • Dec 2006
    • 65

    Get access not to print background color of Form

    The background of my form is dark blue,
    Is there any way to tell access that when printing it should not print the background or it should change the background?
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by emandel
    The background of my form is dark blue,
    Is there any way to tell access that when printing it should not print the background or it should change the background?
    At a guess I would say no because Access prints a snapshop. You could always change the background colour before printing and change it back afterwards I suppose.

    Mary

    Comment

    • emandel
      New Member
      • Dec 2006
      • 65

      #3
      I guess I will just change the color permenantly

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by emandel
        I guess I will just change the color permenantly
        Don't give up too quickly. You shouldn't have to compromise your user interface to accommodate printing. Mmccarthy's suggestion should help, and it's not complicated. Well, to be honest, that probably depends on how the printing is initiated.

        I would imagine there are numerous ways to resolve your problem, some more complex than others. For excample, you could create a print-only version of the form which is never displayed on-screen. You might evcen do this temporarily at run-time.

        Anyway my point is, don't be discouraged just because you can't do it quite as easily as you'd hoped. Look at it as a learning experience. (Besides, it may be as simple as adding two more statements.)

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Something just came to mind. Keep in mind I'm not expert in this area, but couldn't you do something like using an image for the background (I'm not sure how you'd get it to look right), and set the DisplayWhen property for that image to screen only?

          (Hope you saw my earlier message.)

          Comment

          • robertoathome
            New Member
            • Mar 2007
            • 20

            #6
            I'm having the opposite problem, I can't seem to print the backgound color!!
            How did yoiu do it?

            Comment

            • missinglinq
              Recognized Expert Specialist
              • Nov 2006
              • 3533

              #7
              Mary's idea is very simple to implement. If you use the Command Button Wizard to generate a Print Record button, simply modify the code like this:

              Code:
              Private Sub Command5_Click()
              On Error GoTo Err_Command5_Click
              
                'Assign the current  background colors to variables
                
                HeaderDefColor = Me.FormHeader.BackColor 
                DetailDefColor = Me.Detail.BackColor
                FooterDefColor = Me.FormFooter.BackColor
              
                 'Change color to white
                 Me.FormHeader.BackColor = vbWhite 
                 Me.Detail.BackColor = vbWhite 
                 Me.FormFooter.BackColor = vbWhite
                
                 'Print the record
                 DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
                 DoCmd.PrintOut acSelection
                
                 'Change the background color back to the original color
                 Me.FormHeader.BackColor =  HeaderDefColor
                 Me.Detail.BackColor = DetailDefColor  
                 Me.FormFooter.BackColor = FooterDefColor 
              
              Exit_Command5_Click:
              	Exit Sub
              Err_Command5_Click:
              	MsgBox Err.Description
              	Resume Exit_Command5_Click
              End Sub

              Comment

              Working...