User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Aug 2007
Posts: 5
Reputation: venomocity is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
venomocity venomocity is offline Offline
Newbie Poster

A new question about adding and subtracting

  #1  
Aug 19th, 2007
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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2007
Posts: 174
Reputation: plusplus is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
plusplus plusplus is offline Offline
Junior Poster

Re: A new question about adding and subtracting

  #2  
Aug 19th, 2007
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
Reply With Quote  
Join Date: Nov 2006
Posts: 709
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 95
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: A new question about adding and subtracting

  #3  
Aug 19th, 2007
Hi,

use this:
I assume u know how to generate Random Number and is stored in RndVar. If u dont know, i will give u the code...

Dim TLng As Long
TLng = Val(Label1.Caption) - RndVar
Msgbox "Result Is " & TLng

Regards
Veena
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 6:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC