Is there a way to copy the contents of a textbox into a Inputbox?
Printable View
Is there a way to copy the contents of a textbox into a Inputbox?
Try:
________VB Code:
Private Sub Form_Load() Dim sTemp As String sTemp = InputBox("whatever goes here", , Text1.Text) End Sub
Live Sex Webshows
Thankyou for the reply Bruce, but I don't think i explained myself
properly, I want to type a name into a textbox then press a button which calls the input box. I want the name to appear in the
inputbox's typeable field.(I don't know what the real name for the field is)So that the inputbox is kind of a verification tool.(eg.I'll type "Do you want to save this name?" in the inputbox's label)
Thanks,
No worries, try this;
This will place whatever u typed in the TextBox into the InputBox's input field.VB Code:
Option Explicit Private Sub Command1_Click() Dim sTemp As String sTemp = InputBox("whatever goes here", , Text1.Text) End Sub
This will place the contents of TextBox in the Label:
________VB Code:
Option Explicit Private Sub Command1_Click() Dim sTemp As String sTemp = InputBox(Text1.Text) End Sub
WASHINGTON MARIJUANA DISPENSARIES
See above, and here is the InputBox syntax;
InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])
The [xxx] are Optional.
If you want the required field, prompt blank - use "".
So, for what u want to do, we are setting the [default] to the
value of a TextBox :)
________
BeautyDuo
Thanks again Bruce, but it doesn't seem to be working, here's the code:
trFirstName = Trim(InputBox( _
"Enter This Player's Name Into Database?:", , Text1.Text))
strPlayersAddress = Trim(InputBox( _
"Enter Player's Address:"))
strPlayersPhone = Trim(InputBox( _
"Enter Player's PhoneNumber:"))
There's no error message but it doesn't copy the contents.
What am I doing wrong?
That works fine for me?????
I have text in Text1 and the text is placed in the first InputBox's input field.
Then, the other 2 InputBoxes show up!
________VB Code:
Dim trFirstName As String Dim strPlayersAddress As String Dim strPlayersPhone As String trFirstName = Trim(InputBox("Enter This Player's Name Into Database?:", , Text1.Text)) strPlayersAddress = Trim(InputBox("Enter Player's Address:")) strPlayersPhone = Trim(InputBox("Enter Player's PhoneNumber:"))
TreneSexy cam