text boxes to shapes

  • Thread starter Thread starter Nickooo87
  • Start date Start date
N

Nickooo87

Hello,

I am trying to get the user to input their name in a text box and then
have it appear in a shape on the next page.

Public username As String
Sub SetUserdata()
username = TextBox1.Text
ActivePresentation.Slides(2).Shapes
("Name1").TextFrame.TextRange.Text = username
End Sub

above is the code i am using but it doesnt like the TextBox1.Text bit,
anyone know how I can get around this?

thanks

Nick
 
Hello,

I am trying to get the user to input their name in a text box and then
have it appear in a shape on the next page.

Public username As String
Sub SetUserdata()
username = TextBox1.Text
    ActivePresentation.Slides(2).Shapes
("Name1").TextFrame.TextRange.Text = username
End Sub

above is the code i am using but it doesnt like the TextBox1.Text bit,
anyone know how I can get around this?

thanks

Nick

Have you tried putting your code into the Change event for the
textbox?

Private Sub TextBox1_Change()
ActivePresentation.Slides(2).Shapes
("Name1").TextFrame.TextRange.Text = TextBox1.Text
End Sub
 
Have you tried putting your code into the Change event for the
textbox?

Private Sub TextBox1_Change()
    ActivePresentation.Slides(2).Shapes
("Name1").TextFrame.TextRange.Text  = TextBox1.Text
End Sub

Yeah I have tried that, and it doesnt do anything unfortunatly, what
im trying to do is basically carry the value entered in the textbox
over to the next page and then the following slide reads it and
inserts it into an access database with the users answer to a question
 
Yeah I have tried that, and it doesnt do anything unfortunatly, what
im trying to do is basically carry the value entered in the textbox
over to the next page and then the following slide reads it and
inserts it into an access database with the users answer to a question- Hide quoted text -

- Show quoted text -

It works for me. Are you sure you have a textframe named "Name1" on
slide 2?
 
Ive got a shape on the page but its not named!

How do i create a text frame?- Hide quoted text -

- Show quoted text -

Go to Insert:TextBox

NOTE - This is a different type of 'TextBox' than the ActiveX textbox
that you use to allow entering the name during the presentation. This
is a standard PPT textbox.

Make sure to name it the same name you are using in your code (Name1).
If you are using PPT 2007, you can set the name in the 'Selection Pane'
 
Go to Insert:TextBox

NOTE - This is a different type of 'TextBox' than the ActiveX textbox
that you use to allow entering the name during the presentation. This
is a standard PPT textbox.

Make sure to name it the same name you are using in your code (Name1).
If you are using PPT 2007, you can set the name in the 'Selection Pane'

Wicked thats worked now thanks :)

However it now wont take the value over into access

Public username As String

Sub TextBox1_Change()

username = TextBox1.Text
ActivePresentation.Slides(3).Shapes("Name1").TextFrame.TextRange.Text
= username

End Sub

thats the code that I have now and below is the code for entering into
the database

Private Sub button_a_Click()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim strDataSource As String
Dim strProvider As String
Dim strRecordSource As String


strDataSource = "Data Source=" & Application.Presentations(1).Path &
"\Results.mdb"

strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"

strRecordSource = "Results"

cnn.Open strProvider & strDataSource

rst.Open strRecordSource, cnn, adOpenDynamic, adLockOptimistic


rst.AddNew
rst!Student_ID = username
rst!Answer_A = 1
rst!Date_Answered = Now
rst.Update
rst.Close


ActivePresentation.Saved = True


ActivePresentation.SlideShowWindow.View.Next
End Sub

Any ideas why it isnt taking that value?

thanks for your help really appreciated it :)

Nick
 
Back
Top