Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select Case (Access 2000)

    How can i construct properly the Select Case Clause?

    The table size contains the following sizes : 1,3,4,20,60,200

    I want to do something if size = 1 and else if size is not 1.

    I cannot write Case Is size = 1. And if write Case = 1 then nothing happens

    Dim size as control

    Set size = [Forms]![Main]![Subform].[Form].[size]

    Select Case size
    Case is Size = 1
    ...

    Case Else

    ...


    End Select

    I will be much grateful for the help

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select Case (Access 2000)

    For questions like this, you can simply look up the correct syntax in the online help for VBA:
    - Activate the Visual Basic Editor (Alt+F11)
    - Click in the word Case.
    - Press F1 to get help.

    You can simply use Case 1:

    Select Case Size
    Case 1
    ...
    Case Else
    ...
    End Select

    In this specific situation, you might as well use If ... Then:

    If Size = 1 Then
    ...
    Else
    ...
    End If

Posting Permissions

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