|
-
Sep 4th, 2003, 11:35 AM
#1
Thread Starter
Lively Member
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.
-
Sep 22nd, 2003, 08:12 PM
#2
Hyperactive Member
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!!!
-
Sep 23rd, 2003, 07:11 AM
#3
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|