There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
black screen blue screen boot computer connection crash css dell display driver drivers error excel firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem problems ram router slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Displaying a Variable's Value


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
AdmiralZ's Avatar
Senior Member with 219 posts.
 
Join Date: Apr 2005
Experience: Intermediate
19-Aug-2005, 12:41 PM #1
Displaying a Variable's Value
I'm a VB beginner and I'd like to know this:

Say I have a string variable called strName. The value for that variable is "Bob". How do I in a label or a textbox etc. display "<strName> is going to the shops" So that it reads "Bob is going to the shops."

Hope that's clear...
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
19-Aug-2005, 01:25 PM #2
Label1.Caption = strName & " is going to the shops"
AdmiralZ's Avatar
Senior Member with 219 posts.
 
Join Date: Apr 2005
Experience: Intermediate
19-Aug-2005, 04:08 PM #3
That didn't work.
MyName's Avatar
Senior Member with 320 posts.
 
Join Date: Oct 2001
Location: Ohio
Experience: Advanced
19-Aug-2005, 09:47 PM #4
That should have worked. Store strName = "Bob" either in Form Load or if your'e clicking a command button. Then in the code for the command button, Label1.Caption = strName & " rest of sentence." will work. Another way to check would be in the command button code simply type in "Msgbox strName" (without the quotes) and when you click the button it should show you what is stored in the variable.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
20-Aug-2005, 10:49 AM #5
Make sure you have "Option Explicit" at the top of your code. That will ensure that you must declare all variables. Could be the problem.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:00 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.