Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Thanked 0 Times in 0 Posts

    select case or elseif problem (Access 2000)

    Select case or if elseif problem

    I have the following problem.On my main form i have an Option box giving the results of the sales of different branches.
    this is carried out by the function FncBranchSales. On my main form i have also a toggle button called cmdLondon,
    carrying out the function FncBranchsalesLondon.

    I cannot construct the ElseIf or Select Case codes in the right way. This is because in the function FncBranchSales there is a condition to
    perform an action in case i have not selected an option. Therefore ,if i do not choose an option in the option group, i obtain a conflict

    between my 2 functions.
    I think the confclit between my function is due to my wrong Elseif or Select case codes.
    I want to perform a secure operation with the Option Box, in case the toggle button CmdLondon is not selected.Obviuosly my toggle

    button is the reason for my troubles, but i need it.
    Can somebody advise me what is the best way to construct an ElseIf code?

    Below are some of attempts to construct the If sentence, but with no success:

    f Forms![Main]![Office] = True Then ' perform some action only in case the toggle button is not selected
    If Forms![Main]![CmdLondon] = False Then
    FncBranchSales (Me.Name)
    End If
    End If

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 40 Times in 39 Posts

    Re: select case or elseif problem (Access 2000)

    I'm sorry, but I don't understand your situation at all.

    You say you have "... an option box giving the results of of the sales...". What do you mean by this?

    And what is Forms!Main!Office?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: select case or elseif problem (Access 2000)

    If Forms!Main!Office is your option group, it should never be Null, which may be where your problem is coming from. An option group normally has a default value of 0 and an actual value based on whatever option is selected. There is no reason why either an If-End If or a Select Case should not work--simply allow for a value of zero in your option group to handle the situation where no branch was selected. You could also add an option to your group, maybe "All branches", give it a value of 99 or something, and make that the default for the option group.

Posting Permissions

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