vb help please :)

Permabanned
Joined
28 Oct 2006
Posts
6,552
Location
Bournemouth
right, i have 2 combo boxes and i want the code to be like this

this is the English equivalent of what i want to happen

if combo1.text = a and combo2.text = b then output.caption = c * input.text

combo1 would be selected
combo2 also selected
c is a predefined number
input is a number entered by user
output would be the result

now i know this code doesn't work, for i have tried it, but i need a bit of code that does what i want

i am using vb6 btw

thanks in advance

FN
 
Code:
Dim A As String
Dim B As String
Dim C As Integer
A = "A"
B = "B"
C = 4
If Combo1.Text = A And Combo2.Text = B Then
Label1.Caption = Val(Val(Text1.Text) * C)
End If

This works for me. I havn't coded in vb6 for several years so someone please tell me if thats horribly wrong :D
 
Jaffa_Cake said:
Code:
Dim A As String
Dim B As String
Dim C As Integer
A = "A"
B = "B"
C = 4
If Combo1.Text = A And Combo2.Text = B Then
Label1.Caption = Val(Val(Text1.Text) * C)
End If

This works for me. I havn't coded in vb6 for several years so someone please tell me if thats horribly wrong :D

no it looks good, i havnt done vb for ages, and forgot all about dim :o
 
Back
Top Bottom