Results 1 to 3 of 3

Thread: Access 2000 - Print question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    107

    Access 2000 - Print question

    Hi,

    Can someone please tell me how I can print one field in a form? I have a form with a field called directions. I want to have a command button on the form that will print just the field called directions and not the other fields on the form. Can I use code instead of having to create a report and then having the command button open that report? Thank you.

  2. #2
    Hyperactive Member -=XQ=-'s Avatar
    Join Date
    Mar 2002
    Location
    Liverpool, England, UK
    Posts
    278
    I'm fairly sure that MS Access does not support the Printer object like VB6. I have an alternative however... a dodgy one but an alternative all the same:

    Code:
        dim intFree as Integer
    
        intFree = FreeFile
    
        Open "C:\documentpath\text.txt" For Output As #intFree
    
        print #intfree, Field.value 'field is the field you refer to
        
        close #intfree
    
        Shell "NotePad.exe /p ""C:\documentpath\text.txt"""
    
        kill "C:\documentpath\text.txt"
    Wrote this off the top off my head, hence, never tested it... should work though. Let me know if it doesn't.

    I think this is the easiest way for you to print simple text with out setting up a report and filtering it to the field you want.

    Hope this helps.

    -=XQ=-
    See ya later,

    -=XQ=-

    "Reality is merely an illusion, albeit a very persistent one. "
    - Albert Einstein (1879-1955)
    This is the coolest site ever!!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Posts
    107
    Thank you very much!

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