|
-
May 21st, 2007, 07:11 AM
#1
Thread Starter
New Member
print access form to specific printer
Hi, i have been asked if i can set an access database to print to a specific printer rather than the default. i have looked it up and there seems to be a way to print an access report to specific printer. Can the same be done with a form in access?
i have looked at the form in desigtn view and at the print button onclick event i believe it is possible to send from here to a specific printer. Can this be done?
I have a little experience in using vbscript but i have no idea how to do this or even if its possible. any suggestions, tips or where to find an example of how to do this?
-
May 21st, 2007, 12:10 PM
#2
Re: print access form to specific printer
Hi,
Welcome to the forums...
Is the form created in the access database or using VB 6.0?
greg
-
May 21st, 2007, 05:42 PM
#3
Thread Starter
New Member
Re: print access form to specific printer
hi, thanks for answering, the form is in access (2003) and there is a button on the form that prints the data. I looked at it in design view and saw the code -sorry but i havent a clue how this works - but i assume someone used vb in access to create this and the functionality of the form??? i have seen examples of how to enumerate through available printers and print a report in access so can i add to the onclick event of the button on this form and select a specific printer rather than the default printer of the machine?
-
May 22nd, 2007, 05:06 PM
#4
Thread Starter
New Member
Re: print access form to specific printer
here is the code on the form, i'm totally unfamiliar with it, is it possible to tell it to print to a printer other than the default?
Private Sub Command55_Click()
On Error GoTo Err_Command55_Click
Dim stDocName As String
stDocName = "Job Card1"
DoCmd.OpenReport stDocName, acNormal
Exit_Command55_Click:
Exit Sub
Err_Command55_Click:
MsgBox Err.Description
Resume Exit_Command55_Click
End Sub
-
May 23rd, 2007, 12:00 AM
#5
Re: print access form to specific printer
I think there is a command in vb 6.0 to let the user choose the correct printer
when a command button for print is clicked. The command can also be applied to access vba..
Have you tried doing research on the parameters of OpenReport?
greg
-
May 23rd, 2007, 04:28 AM
#6
Thread Starter
New Member
Re: print access form to specific printer
Hi, thanks for that suggestion, as i said i know a little vbscript but this is way beyond me but it makes sense to check out the parameters of OpenReport, i'll try that and see what i can find on that.
I just don't understand how this line opens and prints the doc..
Code:
DoCmd.OpenReport stDocName, acNormal
-
May 23rd, 2007, 10:10 AM
#7
-
May 24th, 2007, 06:01 AM
#8
Thread Starter
New Member
Re: print access form to specific printer
Hi, thanks for the explanation, but i couldn't find any examples of parameters that would select a printer to print to. i am unable to test the application because it is linked with sage on the network, i would have to go to the company and test it there - so trial and error isn't an option...
would something like this work?
Code:
Application.Printer = Application.Printers("my specific printer")
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
|