Printer Control

I have a printer control on my form and when I use it, it prints to the 
default printer. I would like for it to bring up the screen to allow me to 
select which printer to use, like when you use the file/print way.

thanks Blair


Private Sub Command310_Click()
On Error GoTo Err_Command310_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.PrintOut acSelection
    DoCmd.GoToControl "CloseFemaleCards"

Exit_Command310_Click:
    Exit Sub

Err_Command310_Click:
    MsgBox Err.Description
    Resume Exit_Command310_Click

End Sub 


0
Blair
2/24/2007 4:15:00 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
738 Views

Similar Articles

[PageSpeed] 19

This will call the print dialog and print the current form...or report if 
open.

DoCmd.RunCommand acCmdPrint
If Err = 2501 Then Err.Clear

Damon

"Blair" <bemullen@ns.sympatico> wrote in message 
news:u4Nix7CWHHA.1360@TK2MSFTNGP02.phx.gbl...
>I have a printer control on my form and when I use it, it prints to the 
>default printer. I would like for it to bring up the screen to allow me to 
>select which printer to use, like when you use the file/print way.
>
> thanks Blair
>
>
> Private Sub Command310_Click()
> On Error GoTo Err_Command310_Click
>
>
>    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
>    DoCmd.PrintOut acSelection
>    DoCmd.GoToControl "CloseFemaleCards"
>
> Exit_Command310_Click:
>    Exit Sub
>
> Err_Command310_Click:
>    MsgBox Err.Description
>    Resume Exit_Command310_Click
>
> End Sub
> 


0
Damon
2/24/2007 9:30:26 PM
sorry thanks for the help
Blair
"Daniel" <Daniel@discussions.microsoft.com> wrote in message 
news:89058E4A-FE53-4669-8325-EC6AEDCDA656@microsoft.com...
> Blair,
>
> Please do not multi-post questions as you did with this one.  People end 
> up
> answering question twice (or more) this way - when it has already been
> addressed in another group.  It is bad etiquette.
>
> Daniel P
>
>
>
>
> "Blair" wrote:
>
>> I have a printer control on my form and when I use it, it prints to the
>> default printer. I would like for it to bring up the screen to allow me 
>> to
>> select which printer to use, like when you use the file/print way.
>>
>> thanks Blair
>>
>>
>> Private Sub Command310_Click()
>> On Error GoTo Err_Command310_Click
>>
>>
>>     DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
>>     DoCmd.PrintOut acSelection
>>     DoCmd.GoToControl "CloseFemaleCards"
>>
>> Exit_Command310_Click:
>>     Exit Sub
>>
>> Err_Command310_Click:
>>     MsgBox Err.Description
>>     Resume Exit_Command310_Click
>>
>> End Sub
>>
>>
>> 


0
Blair
2/25/2007 2:28:44 AM
thanks Blair
"Damon Heron" <damon327@hotmail.com> wrote in message 
news:uYidnQM7d4_uM33YnZ2dnUVZ_tKjnZ2d@comcast.com...
> This will call the print dialog and print the current form...or report if 
> open.
>
> DoCmd.RunCommand acCmdPrint
> If Err = 2501 Then Err.Clear
>
> Damon
>
> "Blair" <bemullen@ns.sympatico> wrote in message 
> news:u4Nix7CWHHA.1360@TK2MSFTNGP02.phx.gbl...
>>I have a printer control on my form and when I use it, it prints to the 
>>default printer. I would like for it to bring up the screen to allow me to 
>>select which printer to use, like when you use the file/print way.
>>
>> thanks Blair
>>
>>
>> Private Sub Command310_Click()
>> On Error GoTo Err_Command310_Click
>>
>>
>>    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
>>    DoCmd.PrintOut acSelection
>>    DoCmd.GoToControl "CloseFemaleCards"
>>
>> Exit_Command310_Click:
>>    Exit Sub
>>
>> Err_Command310_Click:
>>    MsgBox Err.Description
>>    Resume Exit_Command310_Click
>>
>> End Sub
>>
>
> 


0
Blair
2/25/2007 2:29:11 AM
Reply:

Similar Artilces:

Best way to embed a splitter control in a CpropertyPage?
Can someone point me in the right direction on this? I have a client that wants this kind of UI: 1) UI is property sheet containing an a number of tabs. 2) Each tab's CPropertySheet contains a static splitter. 3) Left pane on splitter is derived from a CFormView and contains a tree control. 4) Right pane contains something based upon a CFormView, dynamically replaceable depending upon what is selected in the tree control I have requirement 4 done and that's no problem. My CSplitterWnd implementation leaves a *lot* to be desired and that's where I need a nudge in the right dir...

Printer unavailable
Strange problem. I cant seem to print in Excel. Everytime I click print or print preview I get the "Current Printer is unavailable". I've tried different drivers, printer..network..local.. nothing. But Word and the other office suites seems to have no problems. I've also tried re-installing Office..also tried different version of Office; 2000, XP, 97... all of them the same with Excel only. I've never seen this error--so take this with a grain of salt. When you said you've tried different printer drivers, did you actually remove the old ones and reinstall--o...

#Name? error in calculated Controls
Hi - I'm having a difficult time figuring out why I am getting the error #Name? in all calculated fields on my report. I have verified that the name of the control is not used in the expression and that there are no erroneous spaces in my expression. The expressions I'm using vary from iif statements to basic arithmetic of two other fields e.g. =[Reimbursement]+[Ineligible] and =IIf([claims]>0,IIf([Total_claims]-[ded]>0,[Total_claims]-[ded]- ([Total_claims]-[ded]-[claims]),0),0) What may be causing these errors? Thanks David When I receive the "#Name?" in a con...

Default printer disappears in Word
Hi everyone, I have deployed some printers in my compagny and, of course, only one by computer is by default. Problem : In word for exemple, I change the printer, and I save it, then I close Word. I open word again, and... the last printer that I have selected appear ( My question is : Why please ?? And how to tell to Word, don't memories the last printer that I have choosen ?? Thank you very much for your help, Fouad Sorry for my english Instead of changing printers from the print dialog and running the risk of changing the default printer in the process, use a...

How to synchronize color between my monitor & printer pub 2003
I can not seem to get my printer to print the same color that I choose. Is there a way to do this? This is a printer issue, most manufacturer's have good support documents on their web sites, this will the place to inquire. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "allora" <allora@discussions.microsoft.com> wrote in message news:1C2DE90F-1AB3-41AD-9FD2-35E61D2C422D@microsoft.com... >I can not seem to get my printer to print the same color that I choose. Is > there a way to do this? ...

New Printer problems
I purchased an HP Photosmart 8250 Printer. I was assured that it would work with all Microsoft programs including Publisher. Guess what - I have spent all day with HP technical support and it still won't work. Publishers envelope orientation and the printer are opposite. I think I will be taking the printer back. It also has a pretty lame paper tray. Can someone suggest to me a printer. I don't do many photos, mostly brochures, letters, envelopes etc. I need help soon Thanks I have the same printer, works for me... In print setup: Paper/Quality tab, click custom... Type 4.125...

How can I control windows from access
I have an access database that is accessed by few users from different computers. I was requested to change the behavior of the database if it was opened on one particular computer to do the following: 1) disable the "Alt-Tab", and "Ctrl-Alt-Delete" buttons so that no one on that machine can go to the desktop 2) no minimizing of the screens is allowed i.e. the forms should always be maximized. 3) the main menu should always be on, and the only way to get out is by clicking the start button on the bottom of the screen to shut down. Is there away to do that? and can I...

Manipulating controls on Dlg Box before displaying, and making modal
Hi all. I'm trying to manipulate CStatic controls within a CDialog window, and diplay the results within a Modal window (in essence, I'm creating my own MessageBox). How do I make this window Modal once I've created it? My code: void CBenchmarkApp::OnImageProperties() //This window is to display image properties { LPCTSTR lpszText_Type; //pointer to constant character string lpszText_Type = "Test"; CWnd* pCWnd = AfxGetMainWnd(); //pointer to CChildView CImageProperties iprop(pCWnd); //Construct iprop object from CImageProperties class iprop.Create(IDD_Image_Properties,N...

Tab Control message handler ?
This is for a dialog-based program. And the code below is a TCN_SELCHANGE message handler for a Tab Control . I am not using a derived class. So, this handler function is in the main dialog class. And the problem is, I am not sure how to write the pointer statements for the "ShowWindow" function calls. Since it is not a member function of CTabCtrl, I am not sure how to write these lines. And it is a member of CWnd. void CTabDemoDlg::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult) { static int nOldTab; int nNewTab = m_cTabCtrl.GetCurSel(); if(nOldTab != nNewTab) { sw...

Date Time Picker control resizing
Hi, I have custom task form with some data fields using the Date Time Picker control. Sometimes, when I click on the drop down in the Date Time Picker to choose a date, the mini calendar becomes really big. If I get out of Outlook and try again sometimes its back to normal other times its can be very big or very small. I'm talking about the actual mini calendar when you click on the drop arrow and not the date field itself. Any help would be great. Thanks That's a known issue with the date picker control. You need code in your Item_Open event handler to size the control as ...

Is the check code necessory in control event function?
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com: 80/support/kb/articles/q180/3/66.asp&NoWebContent=1 From the above article, I learned how to add function to answer for control event. But the implementation of the function, OnDocumentComplete, puzzled me. Is the following code necessory? Why? { IUnknown* pUnk; LPDISPATCH lpWBDisp; HRESULT hr; pUnk = m_webBrowser.GetControlUnknown(); ASSERT(pUnk); hr = pUnk->QueryInterface(IID_IDispatch, (void**)&lpWBDisp); ASSERT(SUCCEEDED(hr)); if (lpDisp == lpWBDisp ) { // Top-l...

How do I create a CCheckListBox control with a dialog resource tem
I want to insert a Checklistbox into my dialog, but there is no tool for it in the standard toolbar. All the information that I have found so far tell sme that I can add one into the resource template, but does not mention how. Any help greatly appreciated! Mkennedy1102 wrote: > I want to insert a Checklistbox into my dialog, but there is no tool for it > in the standard toolbar. All the information that I have found so far tell > sme that I can add one into the resource template, but does not mention how. > Any help greatly appreciated! CCheckListBox uses an ordinary l...

debugging error message: security setting prohibit running Active X controls
Please help me. I have a window appearing all the time when I open up a new e-mail message to send to someone after I went and got help from my DELL support team. The message window that pops up is "Your current security settings prohibit runnings security settings on this page. As a result, the page may not display correctly. What can I do ? At this time I cannot send a picture that's in my signature in outgoing e-mails. Sincerely, Vince :( ...

Printing on a shared printer
I have a HP 5610 All-in-one installed on a desktop running win xp sp 2 that i share on a Dell Studio 17 w/Win 7 Home Premium 64 bit. I have Office Small Business 2007 and cannot print word or excel. I can print from notepad and printer test pages. HP says it has something to do with Office. Can you help? Sure. I can help you if you tell me whether you get any error messages. hth "shwjr" <shwjr@discussions.microsoft.com> wrote in message news:C51D5080-D55D-4765-83F0-35D5136DC75B@microsoft.com... >I have a HP 5610 All-in-one installed on a desktop running win...

Locking (Protecting) Forms and Controls
Quick question. I appreaciate any response. I have implemented checkboxes within an excel file. These checkboxes have no funciton except visually. I have tried everything I can find but cannot protect their STATE ie(checked, unchecked) I want to be able to distribute this file without allowing users to change the state of the checkboxes. I simply cannot find anything on this. Is it possible? if anybody knows please postback thanks. > Quick question. I appreaciate any response. I have implemented > checkboxes within an excel file. These checkboxes have no funciton > except...

Menu control
Hi, Ive bulit an mfc application that has a window and a menu i would like to insert code that disabels an item in the menu once the the user press ok in a dialog ive built. how can i do it? >Ive bulit an mfc application that has a window and a menu i would like to >insert code that disabels an item in the menu once the the user press ok in >a dialog ive built. >how can i do it? Use the menu editor and add an ON_UPDATE handler for the menu item so that you can enable (and disable) it on some state that you preserve from your dialog action. Dave On Sat, 19 Nov 2005 09:14:...

IBM SureMark 4610 RS232 Printer
Hi All, Is anyone using the IBM SureMark 4610 TF6 series printers and the IBM OPOS drivers? I can only get 40 characters to print accross the receipt despite the suggestion in the User manual that it can print 44 chars across. Has anyone encountered this and how did you get around it? Could you send me a receipt template? Regards, Jason. ...

Access combo box control by another data field
Hi, I use a combo box in a form with look-up from a table for selecting data. Easy enough. But, I want to only see a selection of the data in the table, depending on a value in another field in the form. I the combo box table I have ID, data1, and data. data1 is the one that shall be equal to the other field. 1, 1, text1 2, 1, text2 3, 2, texta 4, 2, textb 5, 2, textc etc. I have tried using the standard query that comes with the combo box, and then adding a WHERE statement testing against the data fiel in the form, but it does not work. Any suggestions anyone? Check this link on &...

HELP!!! Control Panel->Mail-> ?
I'm running microsoft outlook 2000. I am not able to setup an outlook profile. I've tried Control panel -> Mail -> but I'm directed to setup an internet connection wizard. I don't see a profiles button. Help! You are probably running Outlook in Internet Mail Only mode. Only Corporate or Workgroup uses profiles. Do you need CW mode? If not, IMO is usually best for home users. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account wi...

printer problems with publisher
New computer and printer ( epson ) I'm working in publisher 2003 and I cant print. " printer not installed on the system". The printer does work in WORD and other applications. Thanks First step: Check the Epson website for an updated printer driver, even if you just bought the printer. It could have been on the store shelf for six months. -- Don Vancouver, USA "dcf" <dcf@discussions.microsoft.com> wrote in message news:DC19DF35-B9B9-4806-9B8E-1ECEEDB8AEDE@microsoft.com... > New computer and printer ( epson ) > I'm working in publisher 2003 a...

Knowledge Base Printer Icon
Users receive the error message "this form has changed and must be saved before printing" when selecting print after opening a knowledge base article from the Service module. Is there a fix for this issue? The print feature works when selecting a knowledge base article from My Workplace. Thank you, Donna ...

Help requested on VBA control
I hope someone here may be able to help, I have an XL sheet with some associated VBA code that runs against a dataset that varies in number although the fields are constant:- (Name) (Next Action) (Last Action) (Time to perform next Action) (Time last action was performed) (Flag 1) (Flag 2) (Unique ID Number) The normal User Form only shows the first 5 items as Flags 1 and 2 are hidden, however I needed to give the user the option to change them which I have done by using an input box with the MSG a string created by looping through N names and having StrMSG = StrMSG + N + Name(N). Thi...

set control handle to default visible / invisible, HOWTO?
Hi Everybody, I have following problem. One way or the other I have changed a setting, only I don't know what, where or how, in such a way that when I try to use a shape from a default stencil, the control handles are all hidden. How can you do this, and even better, how can I make them visible again? I can make a shape's control handle visible by editing it's X Behaviour Value and set it to Visible. But one way or the other this has been changed as the default for all Visio. Thanks for any tip and help!! Erwin Are they Network shapes? I think that the control handles are i...

Suming Data in a Calculeted Control
Hello, I have a filtered form that I have a calculated control on. The control calculates the differences in days of two dates. How do I get a sum of those caluclations? Thank you. Mark Avis Add a control to the Form Footer section. Set its Control Source to =Sum(xxx), where xxx represents the entire expression in your calculated control (without the =.) For example, if your calculated control uses: =[Date2] - [Date1] you will use: =Sum([Date2] - [Date1]) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrown...

count number of characters in rich edit control
How can i count number of characters in rich edit control 2 If u mean controls of type Rich TextBox control, try RichControl1 RC1; CString Mes=RC.GetText(); int n=Mes.GetLength(); "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i count number of characters in rich edit control 2 EM_GETTEXTLENGTHEX, WM_GETTEXTLENGTH, WM_GETTEXT, EM_STREAM* "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i co...