Consulting

Results 1 to 3 of 3

Thread: Stealthy Select…

  1. #1

    Stealthy Select…

    Hello Friends. I am Prabha Karan from Thanjavur (South India). When I was working yesterday in an access tool, I want to get a value from the user and check the entered value with some conditions. So I used the inputbox to get the value and want to use the select case statement to check the value under the conditions. Finally I wanted to display the entered text. How to display the entered text without storing it in a variable? I will give the code. Kindly, explain why this is not happening in this way? Thanks in Advance.
    Select case inputbox (“Enter the value)
    Case conditon1
    ….

    Case condition2
    ….
    ….
    Case else
    “The value you entered is:” ‘Here I want to enter the input value but without using a variable which is an unnecessary one here logically.
    End select

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Idon't think it is Unecessary, it is certainly normal to set an Input to a Variable for later use, so why not stay with convention?

  3. #3
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    There is nothing unnecessary about using a variable for something as simple as this. Variables are containers for values that are used later on in the code.

    The inputbox's value has to be written to a variable. You cannot reference it directly in a Select Case statement.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


Posting Permissions

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