ScottUlmer
New Member
- Joined
- Dec 13, 2016
- Messages
- 29
Hey, so I have a userform which is supposed to update based off of another sheet. The user is given 5 options that update, however only 1,3,4 work while 2,5 do not. I double checked (more like 10x) the file and even copied down the lines that work into where 2 and 5 are located, but no matter what I do the userform will not update to reflect those two. I checked to make sure the options are being noticed when selected via message box (“you chose option 2”) and everything else on it should be uniform and if it works for one, work for all. I checked the links and again, the message box confirmed it is pulling in the data I want, just the userform won’t update when I choose 2 and 5. Any ideas?
Private Sub NextEvent()
If NextEventID = 0 Then
EventID = Sheets("Events").Range("G" & EventID)
End If
If NextEventID = 1 Then
EventID = Sheets("Events").Range("J" & EventID)
MsgBox ("Second option")
End If
If NextEventID = 2 Then
EventID = Sheets("Events").Range("M" & EventID)
End If
If NextEventID = 3 Then
EventID = Sheets("Events").Range("P" & EventID)
End If
If NextEventID = 1 Then
EventID = Sheets("Events").Range("S" & EventID)
End If
Me.Caption = Sheets("Book Settings").Range("B1") & " - " & Sheets("Saved Game").Range("B1") & " " & Sheets("Saved Game").Range("B2") & " - " & Sheets("Events").Range("B" & EventID) & " - " & Sheets("Events").Range("C" & EventID) & " §" & EventID
labelCurrentSelectedOption.Caption = "Please selection an option"
oldHealth = Health + Sheets("Events").Range("T" & EventID)
Health = oldHealth
oldMana = Mana + Sheets("Events").Range("U" & EventID)
Mana = oldMana
oldHunger = Hunger + Sheets("Events").Range("V" & EventID)
Hunger = oldHunger
oldGold = Hunger + Sheets("Events").Range("W" & EventID)
Gold = oldGold
PercentHealth = (Health / MaxHealth) * 100
PercentMana = (Mana / MaxMana) * 100
PercentHunger = (Hunger / MaxHunger) * 100
FormStoryTeller.labelCurrentHealthBar.Width = PercentHealth
FormStoryTeller.labelHealthPercent = "Health: " & PercentHealth & "%"
FormStoryTeller.labelCurrentManaBar.Width = PercentMana
FormStoryTeller.labelManaPercent = "Mana: " & PercentMana & "%"
FormStoryTeller.labelCurrentHungerBar.Width = PercentHunger
FormStoryTeller.labelHungerPercent = "Hunger: " & PercentHunger & "%"
imgEventArt.Picture = LoadPicture(strImageLocation & Sheets("Events").Range("X" & EventID) & ".jpg")
FormStoryTeller.tbEventText.text = Sheets("Events").Range("D" & EventID)
mpOptions.Pages(0).Caption = Sheets("Events").Range("E" & EventID)
mpOptions.Pages(1).Caption = Sheets("Events").Range("H" & EventID)
mpOptions.Pages(2).Caption = Sheets("Events").Range("K" & EventID)
mpOptions.Pages(3).Caption = Sheets("Events").Range("N" & EventID)
mpOptions.Pages(4).Caption = Sheets("Events").Range("Q" & EventID)
tbOption1.text = Sheets("Events").Range("F" & EventID)
tbOption2.text = Sheets("Events").Range("I" & EventID)
tbOption3.text = Sheets("Events").Range("L" & EventID)
tbOption4.text = Sheets("Events").Range("O" & EventID)
tbOption5.text = Sheets("Events").Range("R" & EventID)
Private Sub NextEvent()
If NextEventID = 0 Then
EventID = Sheets("Events").Range("G" & EventID)
End If
If NextEventID = 1 Then
EventID = Sheets("Events").Range("J" & EventID)
MsgBox ("Second option")
End If
If NextEventID = 2 Then
EventID = Sheets("Events").Range("M" & EventID)
End If
If NextEventID = 3 Then
EventID = Sheets("Events").Range("P" & EventID)
End If
If NextEventID = 1 Then
EventID = Sheets("Events").Range("S" & EventID)
End If
Me.Caption = Sheets("Book Settings").Range("B1") & " - " & Sheets("Saved Game").Range("B1") & " " & Sheets("Saved Game").Range("B2") & " - " & Sheets("Events").Range("B" & EventID) & " - " & Sheets("Events").Range("C" & EventID) & " §" & EventID
labelCurrentSelectedOption.Caption = "Please selection an option"
oldHealth = Health + Sheets("Events").Range("T" & EventID)
Health = oldHealth
oldMana = Mana + Sheets("Events").Range("U" & EventID)
Mana = oldMana
oldHunger = Hunger + Sheets("Events").Range("V" & EventID)
Hunger = oldHunger
oldGold = Hunger + Sheets("Events").Range("W" & EventID)
Gold = oldGold
PercentHealth = (Health / MaxHealth) * 100
PercentMana = (Mana / MaxMana) * 100
PercentHunger = (Hunger / MaxHunger) * 100
FormStoryTeller.labelCurrentHealthBar.Width = PercentHealth
FormStoryTeller.labelHealthPercent = "Health: " & PercentHealth & "%"
FormStoryTeller.labelCurrentManaBar.Width = PercentMana
FormStoryTeller.labelManaPercent = "Mana: " & PercentMana & "%"
FormStoryTeller.labelCurrentHungerBar.Width = PercentHunger
FormStoryTeller.labelHungerPercent = "Hunger: " & PercentHunger & "%"
imgEventArt.Picture = LoadPicture(strImageLocation & Sheets("Events").Range("X" & EventID) & ".jpg")
FormStoryTeller.tbEventText.text = Sheets("Events").Range("D" & EventID)
mpOptions.Pages(0).Caption = Sheets("Events").Range("E" & EventID)
mpOptions.Pages(1).Caption = Sheets("Events").Range("H" & EventID)
mpOptions.Pages(2).Caption = Sheets("Events").Range("K" & EventID)
mpOptions.Pages(3).Caption = Sheets("Events").Range("N" & EventID)
mpOptions.Pages(4).Caption = Sheets("Events").Range("Q" & EventID)
tbOption1.text = Sheets("Events").Range("F" & EventID)
tbOption2.text = Sheets("Events").Range("I" & EventID)
tbOption3.text = Sheets("Events").Range("L" & EventID)
tbOption4.text = Sheets("Events").Range("O" & EventID)
tbOption5.text = Sheets("Events").Range("R" & EventID)