Community discussion forum

Input Box function

This is a comment thread discussing Input Box function
  • 10 years ago

    This thread is for discussions of Input Box function.

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 6 years ago

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

  • 6 years ago

    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

  • 6 years ago

    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...??


  • 6 years ago

    the later codes don't work! why?

  • 6 years ago

    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.

  • 6 years ago

    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?
    ??????

  • 6 years ago

    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?
    ??????

  • 6 years ago

    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?

  • 6 years ago

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

  • 6 years ago

    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



  • 6 years ago

    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



  • 5 years ago

     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

  • 5 years ago

    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 years ago

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

  • 5 years ago

    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??

  • 4 years ago

    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

Post a reply

Enter your message below

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