Results 1 to 4 of 4

Thread: Poor in access

  1. #1
    Join Date
    Aug 2004

    Unanswered: Poor in access

    Hi everyone
    I am new to access and the commands are all new to me. I wan to use an "if....else" statement to include two conditions. The two conditions are the site must have an cluster name and whether it is a master site?
    If the site satisfy both conditions, it will go to the next form. It has to satisfy both conditions to go to the next form. If it does not, an error box will come out.

    For the first condition, it is a combo box.
    For second condition, it is a Yes/No box.

    I will be grateful if someone can help me with this "if...else" statement. Thanks a lot.

  2. #2
    Join Date
    Nov 2003
    Sussex, England

    If .. Else

    I think what you are looking for is a nested IF..ELSE. This might work if you adapt it to your database:

    I have a combo box for the form/cluster names and another one for yes/no (too lazy to use a checkbox). The code is accessed by clicking a button:

    Private Sub Command14_Click() '* Name of the button to clivk
    If Me.comForms = "form2" Then '* I have used the name of the form/cluster
    If Me.Combo12 = "Y" Then '* Simple Yes/No
    DoCmd.OpenForm "frmUnit" '* Or whatever form you want to open
    MsgBox "You must select 'form2' and click Yes"
    End If '* combo12
    End If
    End Sub

    The code will need adapting to your needs, and isn't necessarily the best way to implement it. I would be inclined to use a checkbox with a Yes/No label and raise an event when it's clicked, but that might need a bit more explanation than you want at the moment!

    Good luck

  3. #3
    Join Date
    Aug 2004
    okie..I will try and get back to you... Thanks.

  4. #4
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    "YourObject.visible = True/False" will also come in handy for what you would like to do. Don't try to change the type of an object, that's a bitch. Instead have two objects and hide the one you don't need.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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