|
-
Jan 11th, 2000, 05:58 AM
#1
Thread Starter
Lively Member
Ok the I have a form which gets hidden and then another form loads and is supposed to determe what it does due to the values on the last form from a combo box plus an option box or what ever there called I'll give an example of the simple code I am trying to use:
If Form3.Combo1.Text = "Ashenforest" + Form3.Option1.value = True Then
Image1.Picture = LoadPicture("Ashen1.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
End If
If Form3.Combo1.Text = "Ashenforest" + Form3.Option2.value = True Then
Image1.Picture = LoadPicture("Ashen1w.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
End If
If Form3.Combo1.Text = "Ashenforest" + Form3.Option3.value = True Then
Image1.Picture = LoadPicture("Ashen1w.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
End If
now it won't load the picture for some reason, I know it something to do with the option part because when I took out the option part on one of them it worked fine... but I need it to determine which option has been picked.... anyone know what my problem is???
thanx
-
Jan 11th, 2000, 06:13 AM
#2
Change your "+" sings to "&". VB thinks you are trying to add something. Also your code would be slightly faster if you did the following. That way VB won't have to go through 3 If statements even if the 1st one happens to be true.
Select Case True
Case Form3.Combo1.Text = "Ashenforest" & Form3.Option1.value = True
Image1.Picture = LoadPicture("Ashen1.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
Case Form3.Combo1.Text = "Ashenforest" & Form3.Option2.value = True
Image1.Picture = LoadPicture("Ashen1w.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
Case Form3.Combo1.Text = "Ashenforest" & Form3.Option3.value = True
Image1.Picture = LoadPicture("Ashen1w.bmp")
Image1.Height = Screen.Height
Image1.Width = Screen.Width
End Select
------------------
Marty
-
Jan 11th, 2000, 06:20 AM
#3
Hyperactive Member
Hi, there. Actually you have to change + to And
If Form3.Combo1.Text = "Ashenforest" AND Form3.Option1.value = True Then ...
Larisa
-
Jan 11th, 2000, 07:36 AM
#4
LG is right! Boy am I embarrased 
------------------
Marty
-
Jan 11th, 2000, 05:14 PM
#5
Lively Member
Dim sBitmap as String
With Form3
If .Combo1.Text = "Ashenforest" Then
' Since only one option can be selected at a ' time it is safe to do this:
If .Option1 Then sBitmap = "Ashen1.bmp"
If .Option2 Then sBitmap = "Ashen1w.bmp"
If .Option3 Then sBitmap = "Ashen1w.bmp"
Image1.Picture = LoadPicture(sBitmap)
Image1.Height = Screen.Height
Image1.Width = Screen.Width
End If
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|