Results 1 to 7 of 7

Thread: Inputbox problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    118

    Inputbox problem

    Is there a way to copy the contents of a textbox into a Inputbox?

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Try:
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim sTemp As String
    3.    
    4.     sTemp = InputBox("whatever goes here", , Text1.Text)
    5.    
    6. End Sub
    ________
    Live Sex Webshows
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:54 AM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    118
    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,

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    No worries, try this;
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     Dim sTemp As String
    5.    
    6.     sTemp = InputBox("whatever goes here", , Text1.Text)
    7.  
    8. End Sub
    This will place whatever u typed in the TextBox into the InputBox's input field.

    This will place the contents of TextBox in the Label:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     Dim sTemp As String
    5.    
    6.     sTemp = InputBox(Text1.Text)
    7.  
    8. End Sub
    ________
    WASHINGTON MARIJUANA DISPENSARIES
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:54 AM.

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    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
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:54 AM.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    118
    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?

  7. #7
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    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:
    1. Dim trFirstName As String
    2. Dim strPlayersAddress As String
    3. Dim strPlayersPhone As String
    4.  
    5. trFirstName = Trim(InputBox("Enter This Player's Name Into Database?:", , Text1.Text))
    6. strPlayersAddress = Trim(InputBox("Enter Player's Address:"))
    7. strPlayersPhone = Trim(InputBox("Enter Player's PhoneNumber:"))
    ________
    TreneSexy cam
    Last edited by Bruce Fox; Aug 14th, 2011 at 04:55 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width