Library tutorials & articles

Input Box function

Introduction

You can use the input box to retrieve a string from the user like

Comments

  1. 22 Mar 2004 at 23:36
    Hi
    I want to reduce the  width of text box on InputBox & to change the location of the Buttons & textbox,
    is it possible?

    Regards
    Mahesh
  2. 25 Dec 2003 at 17:57

    what i want is a login form, but i cant get it to keep focus like when you have a messagebox or inputbox open you cant click the main form, how do i do that??

  3. 28 Jul 2003 at 01:06

    Suppose they just don't put anything in the box and click OK?

  4. 28 Jul 2003 at 01:05

    Unfortunately the input box isn't all the flexible. (You can't even hide the Cancel button.) You should use a custom form, it looks neater for getting 2 pieces of info anyway.

  5. 25 Jun 2003 at 02:41

     Can u use Input Box to also collect password (ie starred input) also.
    I have a requirement whereby the program has to wait for input of userid and password . Input box works fine but I am not able to make the password as password field. is there any property in input box to achieve this
    Or
    I have to use something else. If so then what shud i use.
    Regards
    Tirthankar

  6. 20 Nov 2002 at 19:28

    Do this....


    Code:

    i = InputBox("Question: blahblahblah?", "Q&A")


    If i = "" Then Exit Sub ' leaves sub if the variable i is null


    YOUR CODE HERE



  7. 20 Nov 2002 at 19:28

    Do this....


    Code:

    i = InputBox("Question: blahblahblah?", "Q&A")


    If i = "" Then Exit Sub ' leaves sub if the variable i is null


    YOUR CODE HERE



  8. 19 Nov 2002 at 14:54

    To end it, just add the line "exit sub" to your If statement where the string = "".

  9. 11 Nov 2002 at 22:48
    What about if the user chooses Cancel?
    I made a small program (guessing game) that uses the inputbox, but how would I go about ending it when they choose cancel and not get an Error?
  10. 01 Oct 2002 at 12:59

    u didn't answer it so i started a new topic:
    the codes with the () do it too!
    it says "statement invalid outside type block" (and i always put it in the button click...)
    and when i press ok it shows me the code:
    Private Sub Command1_Click() -in yellow
    DocName As String -in blue
    and the rest of the code is ok.....
    what's the problam?
    ??????

  11. 01 Oct 2002 at 09:31

    the codes with the () do it too!
    it says "statement invalid outside type block" (and i always put it in the button click...)
    and when i press ok it shows me the code:
    Private Sub Command1_Click() -in yellow
    DocName As String -in blue
    and the rest of the code is ok.....
    what's the problam?
    ??????

  12. 30 Sep 2002 at 12:59

    Apologies.


    DocName = InputBox "Please enter the documents title", _
                     "Enter Title", "Document 1"


    should have been


    DocName = InputBox ("Please enter the documents title", _
                     "Enter Title", "Document 1")


    I've corrected the article.

  13. 30 Sep 2002 at 11:59

    the later codes don't work! why?

  14. 15 Aug 2002 at 16:57

    Is there a way to protect the contents entered into an input box?
    ie..place asterisks over what someone types to protect a password.


    If not...how can I prompt a user for input and protect what they enter using VB script...??


  15. 28 Jan 2002 at 02:01

    anywhere you wanna dude.


    you can do this:


    call inputbox("Do you really wanna?")


    or


    strBox= inputbox("Do ya?")


    or even:


    savesetting("WhatDa", "Who", "Ha", inputbox("Do da Day"))


    not that hard, can be used anywhere you wanna

  16. 27 Jan 2002 at 23:01

    Does the code for Input Box go in the Load Form section?

  17. 01 Jan 1999 at 00:00

    This thread is for discussions of Input Box function.

Leave a comment

Sign in or Join us (it's free).

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...
AddThis

Related discussion

Related podcasts

  • Christian Beauclair

    14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...

We'd love to hear what you think! Submit ideas or give us feedback