By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

Setting up a form to print one label for a specific record

P: 37
I am using code for printing a label for a specific record from the following website:

** Edit ** Removed link

When I try to execute using the print button on my form, I get an error (see attachment).

Please help. I am not great with code so I will need specific code to make this will work properly.

Thank you!

Yappy
Attached Files
File Type: zip Label Syntax Error.zip (56.8 KB, 40 views)
Aug 5 '10 #1

✓ answered by Steven Kogan

You have an extra line after the line separator.

Simply remove the blank line between 'msgbox' and 'vbOKOnly' and it should work.

You'll probably get a faster responses if you do need to use an attached file: people are hesitant to open attachments.

Expand|Select|Wrap|Line Numbers
  1. MsgBox "Can't print an unsaved record", _
  2. vbOKOnly, "Error"

Share this Question
Share on Google+
6 Replies


Expert 100+
P: 107
You have an extra line after the line separator.

Simply remove the blank line between 'msgbox' and 'vbOKOnly' and it should work.

You'll probably get a faster responses if you do need to use an attached file: people are hesitant to open attachments.

Expand|Select|Wrap|Line Numbers
  1. MsgBox "Can't print an unsaved record", _
  2. vbOKOnly, "Error"
Aug 5 '10 #2

P: 37
Thanks Steven for your help. I changed the line as you suggested & it is working!

Would it be possible to add code to the existing code so that I could specify the number of labels to skip when printing the record specific label?

Thanks,
Yappy
Aug 6 '10 #3

Expert 100+
P: 107
There is an article on how to do that at:
** Edit ** Removed link
Aug 6 '10 #4

NeoPa
Expert Mod 15k+
P: 31,769
I'm sorry guys, but the rules forbid linking to competing forum sites.

If you have a question or an answer it can be posted here in full, without reference to questions or solutions posted on such sites.
Aug 6 '10 #5

P: 37
Thanks, Steven for all your help! I have everything working fine now.
Aug 9 '10 #6

P: 37
Thanks NeoPA for the heads up. I will keep that in mind for future posts.
Aug 9 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.