• select case or elseif problem (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » select case or elseif problem (Access 2000)

    Author
    Topic
    #366028

    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)
    Else
    FncBranchSalesLondon
    End If
    End If

    Viewing 1 reply thread
    Author
    Replies
    • #566516

      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?

    • #566541

      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.

    Viewing 1 reply thread
    Reply To: select case or elseif problem (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: