•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 397,592 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,867 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 436 | Replies: 2 | Solved
![]() |
•
•
Join Date: Aug 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
First of all let me say I love this forum, everyone has been very nice and extremely helpful! Now to my question.
I got help with a question like this before and the answer I got worked perfectly. However I have a new angle. I'm wanting to take and subtract from a caption but after a random number has been chosen. Thus lets say at the click of a button a random number of 6 is picked. I want that to be subtracted from a caption that is set at 100. Thanks in advance for all the help!
I got help with a question like this before and the answer I got worked perfectly. However I have a new angle. I'm wanting to take and subtract from a caption but after a random number has been chosen. Thus lets say at the click of a button a random number of 6 is picked. I want that to be subtracted from a caption that is set at 100. Thanks in advance for all the help!
•
•
Join Date: Jul 2007
Posts: 174
Reputation:
Rep Power: 2
Solved Threads: 16
Not sure understood your question, do you want to for ex subtract the number entered in label2 from label1 ? If so do the following
If IsNumeric(Me.Label1.Caption) Then
if IsNumeric(Me.Label2.Caption) then
Me.Label1.Caption = Me.Label1.Caption - Me.Label2.Caption
end if
end if
Or do you want to prompt the user for a number? Then use Inputbox
If IsNumeric(Me.Label1.Caption) Then
if IsNumeric(Me.Label2.Caption) then
Me.Label1.Caption = Me.Label1.Caption - Me.Label2.Caption
end if
end if
Or do you want to prompt the user for a number? Then use Inputbox
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
- Pointers (archived tutorial) (C++)
- Best way to develop db for survey? (Database Design)
- Monitor not doing true color anymore (Windows 9x / Me)
- Program Output Display Tweak Help (Java)
- Classes (C++)
- Using binary operators! (C)
- Pointers (C++)
- New Motherboard & Pre-installed Windows XP (Windows NT / 2000 / XP / 2003)
- a program about fractions (C++)
- Open proxy? (Windows NT / 2000 / XP / 2003)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: problem with opening form
- Next Thread: help me i cant found any fault


Linear Mode