For some reason when the cmdPrint is depressed and the date range is choosen nothing prints. Don't know what is missing in the code. I have attached my workbook.
For some reason when the cmdPrint is depressed and the date range is choosen nothing prints. Don't know what is missing in the code. I have attached my workbook.
Hello PANTECH,
The problem I see is there is no code behind the cmdPrint button. Did you post the most version of the workbook?
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
You didn't copy the code for cmdPrint on the main form and you've removed the code to actually print from cmdPrint on frmPrint.
If posting code please use code tags, see here.
That is the latest worksheet all the code is under frmPrint.
Added 'Application.PrintCommunication = False
'Application.PrintCommunication =True
Now date range doesn't work. Attached is current workbook
Last edited by PANTECH; 04-18-2013 at 02:23 PM.
The code to do the actual printing is still missing.
It was commented out in the original code for the reason I said in the other thread and Application.PrinterCommunication was commented out because it's not
available in Excel 2003.
So what (in detail) needs to been done to make this print?
Uncomment the PrintOut line in this, the original, code.
PS Why didn't you continue in the original thread?![]()
Please Login or Register to view this content.
Please take another look, when I press print I now longer get the pop up for the date range. Now that worked yesterday but printing still is not working. The latest workbook is attached. Really appreciate the help. You'll get 5 gold stars if you can make this work!
Still no code to open the print form.
In design view double click the Print button.
You'll now see this.
This is where you need to put the code to open the userform.![]()
Please Login or Register to view this content.
For example, this, the original code.
![]()
Please Login or Register to view this content.
I followed your instructions, now getting Run-time error '400': Form already displayed; can't show modally. When I click on debug it takes me to the code line frmPrint.Show this line is in yellow. What did I miss, attached current workbook.
Why do you have this code in the cmdPrint click event on frmPrint?
It only goes in the cmdPrint click event on the main form, frmINVENTORY.![]()
Please Login or Register to view this content.
Made corrections to code frmPrint.Show to cmdPrint.Show. Now I get complie error: Method or data member not found. Remember I am not a professional programmer. Just messing with VBA, this is mine first userform. This is all new to me!
Remove the highlighted code from here.
![]()
Please Login or Register to view this content.
Now getting Run-time error '438' Object doesn't support this property or method. Below is hilighted.
.Print Copies:=1
Why did you change PrintOut, which was in the original code, to Print?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks