Hi
I would just like to know how i would limit a labels character to a maximum of 6 ???
I have a calculation that brings a result into a label but now the full answer is displayed, which wld be like 21.2565458658966 and i would like to only have the first 6 characters, 21.25
something like that
7 1242
Hi
I would just like to know how i would limit a labels character to a maximum of 6 ???
I have a calculation that brings a result into a label but now the full answer is displayed, which wld be like 21.2565458658966 and i would like to only have the first 6 characters, 21.25
something like that
One way for you to do that, is convert it to a single, you will get about 8 characters from the example you gave above, -
dim Result as single
-
Result = 21.2565458658966
-
Result = csngl(Result) '// Result for This = 21.25655
-
MyLabel.Caption = Result
-
-
Or you can cut the length via the Left$ sub -
dim Result as Double
-
Result = 21.2565458658966
-
'//Change the Number 6 below for different legnths
-
MyLabel.Caption = Left$(Result, 6) '//Result for this shows 21.256
-
I hope this helps you
Kind Regards
Devon
One way for you to do that, is convert it to a single, you will get about 8 characters from the example you gave above, -
dim Result as single
-
Result = 21.2565458658966
-
Result = csngl(Result) '// Result for This = 21.25655
-
MyLabel.Caption = Result
-
-
Or you can cut the length via the Left$ sub -
dim Result as Double
-
Result = 21.2565458658966
-
'//Change the Number 6 below for different legnths
-
MyLabel.Caption = Left$(Result, 6) '//Result for this shows 21.256
-
I hope this helps you
Kind Regards
Devon
it says..... Conversion from label.text to single is not allowed
One way for you to do that, is convert it to a single, you will get about 8 characters from the example you gave above, -
dim Result as single
-
Result = 21.2565458658966
-
Result = csngl(Result) '// Result for This = 21.25655
-
MyLabel.Caption = Result
-
-
Or you can cut the length via the Left$ sub -
dim Result as Double
-
Result = 21.2565458658966
-
'//Change the Number 6 below for different legnths
-
MyLabel.Caption = Left$(Result, 6) '//Result for this shows 21.256
-
I hope this helps you
Kind Regards
Devon
Hi Devon.
I got the problem.
i used variables
and i changed it to single and now it works fine.
THanks
Hmm, the difference being ure using a new version of Visual Basic or your in .NET that might be were the confusion came in, apologies for that.
I hope i offered a breif insight into what you needed
Kind Regards
Devon
Hmm, the difference being ure using a new version of Visual Basic or your in .NET that might be were the confusion came in, apologies for that.
I hope i offered a breif insight into what you needed
Kind Regards
Devon
No you did get me on the right track so it's all good.
Thanks Devon
Have anyone considered using the Round function.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: madeo |
last post by:
hi,
i'm looking for some script which would export address labels from a
mysql db to pdf ...
There's an exapmle, but i'm not able to convert it for using with
mysql ... can anybody help?
THX...
|
by: Martin O'Rourke |
last post by:
All,
I am hoping someone might be able to put me out of my misery and let me
know if it is possible or not to dervie the name of an element in a
form, based on its associated label, only knowing...
|
by: DBQueen |
last post by:
I have a database which will be printing out labels for SMALL test tubes
(1/4" high). We have yet to find a reasonably-priced printer (labelwriter)
which can effectively print this on ROLLS of...
|
by: DebbieG |
last post by:
I am creating a database for a small department in a university. Each
student in their database can have 2 mailing addresses. They wanted mailing
labels pulling just the 1st address. No problem....
|
by: Grim Reaper |
last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a
week. I have been having problems with one thing since I have been printing
mailing labels.
I print mailing labels by...
|
by: Grim Reaper |
last post by:
I know this is probably an easy question, but I could not find/figure it
out.
Basically, I am printing mailing labels with a "Sorting/Grouping" section
that groups the label types together....
|
by: John Smith |
last post by:
Perhaps the wrong place to ask but...Friend has names and addresses in
Microsoft Works Database...how can she print off address labels from this
database?
Thanks,
John
|
by: John Baker |
last post by:
Hi:
I have a user who has labels that are set up 3 across and 11 vertical (which is unusual at
best), and he wants me to print names and addresses on them. I have already set up for
labels 10...
|
by: Ron |
last post by:
Hi,
I know Access allows for easy construction of a report setup to print labels
from a table/query, etc. I've done that one. It works pretty well for what
I need.
However, is there an...
|
by: xikom01 |
last post by:
In this age, there is a lot of focus on the importance of "getting
organized." There are even professional organizers for hire! Labels
are a huge presence in the field of organization, because they...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |