Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178

    Question Unanswered: prompt for input from user

    whats the quickest way that i can prompt the user to enter a value so that i can use that value in the code. eg. prompt the user to enter a starting number and an ending number?

    thanks in advance
    ActionAnt

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    SQL:

    Select *
    from table
    where column = [param]
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178
    I want to get the value from a msgbox

  4. #4
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    This is the quickest prompt, an inputbox...BUT it isnt formatted so you'll have to use code to sort out all the variations.

    Start_number= InputBox("Please enter a start number", "Start number")
    End_number = InputBox("Please enter a end number", "End number",)


    ~Ken

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: prompt for input from user

    Originally posted by actionant
    whats the quickest way that i can prompt the user to enter a value so that i can use that value in the code. eg. prompt the user to enter a starting number and an ending number?

    thanks in advance
    ActionAnt
    In what code? Where?

    I want to get the value from a msgbox
    A VBA MsgBox? Not gonna happen ... Custom? Well, you're gonna build a form to do that anyway ...

  6. #6
    Join Date
    Jan 2004
    Location
    South Africa
    Posts
    178
    thanks for the help

  7. #7
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    You can do that with something like this:


    Dim...
    message = "Your mess here." ' Set prompt.
    title = "Title Mess here" ' Set title.
    myvalue = InputBox(message, title) ' user enter the value

    You can control the entered value with
    If myvalue...


    I hope this help.

    Ruas

  8. #8
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    You get this:

    (See the attached image)

    Ruas
    Attached Thumbnails Attached Thumbnails mess.jpg  

  9. #9
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404

    Re: prompt for input from user

    Originally posted by actionant
    whats the quickest way that i can prompt the user to enter a value so that i can use that value in the code. eg. prompt the user to enter a starting number and an ending number?

    thanks in advance
    ActionAnt
    The best way is to build a new form, get the input either in a text box or, if you have a limited range, a combo box. Don't forget to make the form open as a dialogue form. This way you have control over what is entered, and you can use code to validate.

    The quickest way is via an input$ box, but you have no control over what the user enters, and the entry is always treated as a string, so you'll still need some code somewhere!

Posting Permissions

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