Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    United Kingdom
    Posts
    56

    Unanswered: Null and not Null parameters into an If statement

    Hey guys,

    I hope someone can help me. I need the code below to run only if the field "Surname" is NOT null AND “address1” OR “address2” is null.

    Any ideas of how to incorporate null and not null parameters into an If statement?

    Rusty


    Code:
    Private Sub labelProjects_Click()
    If IsNull(Me.address1) Or IsNull(Me.address2) Then
    Me.Surname.SetFocus
    Me.address1.SetFocus
    MsgBox "Please enter data for Address1 AND Address2"
    Else
    DoCmd.Close acForm, "frmAddPerson"
    DoCmd.Close acForm, "PROJECTS2"
    DoCmd.OpenForm "PROJECTS2", acNormal, "", "", , acNormal
    DoCmd.Maximize
    End If
    End Sub

  2. #2
    Join Date
    Sep 2004
    Posts
    161
    Same response, you have wrote the statement in your question
    if "Surname" is NOT null AND (“address1” OR “address2” is null)

Posting Permissions

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