Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerpoint VB - Next screen based on textbox criteria 1

Status
Not open for further replies.

verizonrep

Programmer
Oct 29, 2002
48
US
I have never done VB in Powerpoint (just Excel and Access). I'm building a slideshow that prevents people from moving on to another slide until I have given them an access code. I have a textbox and a button on a slide.

Goal - make it so that when a number or phrase (like "go") is input into the slide's textbox, and the button is pushed, it moves to the next slide.

I thought the VB would go something like this, but it's not working. The button is called NextSlide_Click and the textbox is called Textbox1

Sub NextSlide_Click()

If ("TextBox1")= "GO" then
SlideShowWindows(Index:=1).View.Next
Else
Exit Sub
End Sub

If I take the if statement out (just having the SlideShowWindows(Index:=1).View.Next line, it sends it to the next slide, but I want to base it off a criteria.

Any thoughts?
 
Private Sub CommandButton1_Click()
If TextBox1.Value = "go" Then
SlideShowWindows(1).View.Next
Else
Exit Sub
End If
End Sub
 
Thanks. I figured it had to be something simple. You really helped me out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top