Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2006
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select Case (Access 2000)

    How can i best make the Select Case when the toggle button is pressed and when not? I want to use the select case since i have seceral If cases too and thus it will be clearer.
    Is it right what i have written below?

    Select Case Me!TglPriceChange
    case 1
    Me!TglPriceChange =True
    case else
    Me!TglPriceChange = False
    End Select

  2. #2
    5 Star Lounger
    Join Date
    Apr 2003
    Location
    Hampshire, United Kingdom
    Posts
    602
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select Case (Access 2000)

    Welcome to Woody's Lounge.

    Firstly, I think you'd be better off using an "if" statement here:
    If Me!TglPriceChange Then
    ...
    Else
    ...
    End If

    - it's just as clear as Select Case!

    Secondly, I'm not sure exactly what you're trying to achieve. At the moment, your code reads as follows:
    If TglPriceChange equals 1 (=true) then set tglPriceChange to True. Otherwise (TglPriceChange is False) set TglPriceChange to False.
    In other words, it doesn't do anything! What would you like it to do?
    Waggers
    If at first you do succeed, you've probably missed something.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Select Case (Access 2000)

    A togglebutton is a True/False button, so your code would be clearer if you wrote:

    <code>Select Case Me!TglPriceChange
    Case True
    ...
    Case Else
    ...
    End Select</code>

    If you are trying to automate toggling the button, you would do it like this:

    <code>Me!TglPriceChange = Not Me!TglPriceChange</code>
    Charlotte

Posting Permissions

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