Welcome to Dream.In.Code
Become a VB Expert!

Join 149,485 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,347 people online right now. Registration is fast and FREE... Join Now!




help with getting value of label.caption for operation

 
Reply to this topicStart new topic

help with getting value of label.caption for operation

suck-3-r
3 May, 2007 - 09:17 AM
Post #1

New D.I.C Head
*

Joined: 3 May, 2007
Posts: 1


My Contributions
Private Sub Command3_Click() 'set alarm time for comp1 & time in
Command1_Click

If (Val(Combo1.Text) = Label22.Caption) And (Val(Combo2.Text) = Label23.Caption) Then
If MsgBox("Set time over for Computer 1", vbOKCancel, "Time Over") = vbYes Then
Command2_Click

End If
End If

End Sub

======

I'm trying to retrieve the integer values of combo1.text, label22.caption...etc. to be able to apply operations on them like comparison or even addition. i cannot find a way to do it.. thanks smile.gif
User is offlineProfile CardPM
+Quote Post

tody4me
RE: Help With Getting Value Of Label.caption For Operation
3 May, 2007 - 11:16 AM
Post #2

Only Jenny Craig makes thin clients...
Group Icon

Joined: 12 Apr, 2006
Posts: 1,349



Thanked: 5 times
Dream Kudos: 100
My Contributions
you're comparing 2 different types, it will never execute the messagebox. change to val(combo1.text) = val(label22.caption) for both sides of the if statement. .Caption is string and .Text is string. You could also get rid of the Val in fron of the combo boxes.
User is offlineProfile CardPM
+Quote Post

melonchollie540
RE: Help With Getting Value Of Label.caption For Operation
3 May, 2007 - 04:49 PM
Post #3

New D.I.C Head
*

Joined: 6 Feb, 2007
Posts: 29


My Contributions
For simpler coding i would make the text value of the combo box set into a variable.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 04:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month