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

How to insert ASCII 30 into a label caption using VBA

Seth Schrock
Expert 2.5K+
P: 2,951
I'm trying to insert an up arrow (ASCII 30) into my label caption using VBA. In researching online I discovered that I could do it manually by holding the ALT key and then keying in 30 on the number pad. This works perfectly. However, if I try to concatenate Chr(30) to the end of the existing caption in VBA, it just puts a space. Surely if I can do it manually, I should be able to do it using VBA, but I just can't figure out how.
Mar 18 '14 #1
Share this Question
Share on Google+
8 Replies


zmbd
Expert Mod 5K+
P: 5,397
Seth,
ASCII(30) is a record seperator and is usually a non-printable
http://www.ascii-code.com/

So what is it that you are actually wanting to do?
Mar 18 '14 #2

Seth Schrock
Expert 2.5K+
P: 2,951
I'm not wanting to separate records, I'm wanting to display it (as well as ASCII 31). There is a symbol related to both. Again it worked when I typed it manually. I just want to automate that if possible.
Attached Images
File Type: jpg ascii list.jpg (149.4 KB, 4650 views)
Mar 18 '14 #3

Seth Schrock
Expert 2.5K+
P: 2,951
The other option would be to concatenate some unicode characters (U+25B2 & U+25bc) instead of the ASCII characters, but I couldn't get that to work either using the StrConv() function. All I got was a mess of weird symbols.
Mar 18 '14 #4

zmbd
Expert Mod 5K+
P: 5,397
Seth, 30 and 31 are non-printables in the full ASCII standard.
The image you attached is the IBM modified graphics code which is NOT an ASCII implementation.

Look at your inserted image for CHR(10) which is a BackLit-Circle - now we KNOW that this is the line feed in ASCII

Look at your inserted image for CHR(13) which is a Musical 1/8th note - now we KNOW that this is the carrage return in ASCII

This is old school stuff, I cut my programming teeth on ASCII (^_^)
http://en.wikipedia.org/wiki/ASCII


As for using the unicode, that might be your best bet.


EDIT>>
Seth, we've already been thru this here:
http://bytes.com/topic/access/answer...n-arrows-label
Mar 18 '14 #5

Seth Schrock
Expert 2.5K+
P: 2,951
Well, Access recognizes 30 and 31 as symbols when entered manually (see attached). How it works I don't know, but it does display as I'm wanting.

As for using the unicode method, how do I do it? This is what I tried:
Expand|Select|Wrap|Line Numbers
  1. Me.WireDateTime_Label.Caption = strLabelCaption & " " & StrConv("▲", vbFromUnicode)
Attached Images
File Type: png ASCII Arrows.png (4.7 KB, 745 views)
Mar 18 '14 #6

Seth Schrock
Expert 2.5K+
P: 2,951
I got is using the unicode characters.
Expand|Select|Wrap|Line Numbers
  1. Me.WireDateTime_Label.Caption = strLabelCaption & " " & ChrW(9650)
Mar 18 '14 #7

zmbd
Expert Mod 5K+
P: 5,397
That code worked in my test database.

As for using the alt+30; alt+030; alt+0030 to directly enter the block-up, it doesn't work on my version of ACC, I tried Times New Roman, Block, etc.. for the fonts and none of these worked for me; however the bell did ring chr(7) (^_^) .
Mar 18 '14 #8

Seth Schrock
Expert 2.5K+
P: 2,951
I'm using Access 2010, Calibri font to get that screen shot. The website I got the key combination from was Insert ASCII or Unicode Latin-based symbols and characters and it says it applies to Access 2007.

Another piece of strange behavior for Access I guess.
Mar 18 '14 #9

Post your reply

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