Results 1 to 2 of 2

Thread: PrompT

  1. #1

    Thread Starter
    Addicted Member Sonikku`'s Avatar
    Join Date
    Oct 2002
    Location
    NyC~
    Posts
    165

    PrompT

    What was that command that makes a MsgBox pop up with textbox on the bottom, And how do I refer to the testbox. Thank You.

  2. #2
    Frenzied Member
    Join Date
    Jan 2000
    Location
    Bellevue, WA, USA
    Posts
    1,357

    That's the InputBox function.

    You pass the InputBox function the Caption, the Title, and Default text (if you want). The function returns the text that was in the text box when the user pressed Ok. The return value will be an empty string if they pressed Cancel.

    Here's a quick example:
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim strReturnValue As String
    3.    
    4.     strReturnValue = InputBox("Please enter your name below:", _
    5.         "Enter Your Name", "<type your name here>")
    6.    
    7.     If strReturnValue = "" Then
    8.         MsgBox "You hit cancel, or you didn't type a name!"
    9.     Else
    10.         MsgBox "Well hello, " & strReturnValue & ", nice to meet you."
    11.     End If
    12. End Sub
    ~seaweed

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