Print on Form in VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaiful
    New Member
    • Oct 2007
    • 89

    Print on Form in VBA

    Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
    Dim MyVar
    MyVar = "Hello."

    Print MyVar

    its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by shaiful
    Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
    Dim MyVar
    MyVar = "Hello."

    Print MyVar

    its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
    Hello shaiful!

    Are you using our wonderful Access wizard? Access does it all for ya, you probably know this, just mentioning it. You can turn on your wizard and grab the Print Form method there. Provided I know what you are truly referring to.

    Please stay tuned if not so...

    In a bit!

    Dököll

    Comment

    • shaiful
      New Member
      • Oct 2007
      • 89

      #3
      Originally posted by Dököll
      Hello shaiful!

      Are you using our wonderful Access wizard? Access does it all for ya, you probably know this, just mentioning it. You can turn on your wizard and grab the Print Form method there. Provided I know what you are truly referring to.

      Please stay tuned if not so...

      In a bit!

      Dököll
      Hi , thx , actually i cant get any text print on form, thx again

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        It works in vb6, but it doesnt work in VBA?
        That's correct! While VBA and VB6 share a lot of functions, they are not the same language! They are not intended to do the same things! Think about it! What reason would a database program have for printing a single line of code? In Access you can print out Forms (although except in a very few specialized situations you shouldn't) and Reports. There's really no reason for a databse program to print out anything else.

        And I have no idea what "could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form?" means.

        Linq ;0)>

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by shaiful
          Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
          Dim MyVar
          MyVar = "Hello."

          Print MyVar

          its works in vb6, but it doesnt work in VBA? could u pls tell my how i can just put a line on form on left top corner or I can mention the location of print a text on form? Thx a lot
          Linq provided an excellant Response to your question in Post #4. I think you are getting confused with Visual Basic where you can specify CurrentX and CurrentY positions within the context of certain Objects, then start Printing at specific locations. This capability does not exist in VBA, nor should it.

          Comment

          Working...