Help with If Then statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • beconrad@yahoo.com

    #1

    Help with If Then statement

    Hi all,

    I have an if then statement coded as an after update event procedure on
    a data entry form. It works perfectly on an Access 2000 database, but
    when I try the same query on an Access 2002 database I get a "variable
    not found" message. I have verified that the field names are correct
    but I still cannot get it to work.

    The query is as follows:.

    If [MaritalStatus] = "Married-Living Together" Then
    [SpouseName] = IsNotNull
    Else
    [SpouseName] = Null
    End If

    Is there something I am missing, or something that changed between the
    two versions of Access?

    Any help is greatly appreciated.

    Thanks,
    Bonnie
    beconrad@yahoo. com

  • Rich P

    #2
    Re: Help with If Then statement

    Hi Bonnie,

    From what I understand about your problem, you have a data entry form,
    and an After_Update event fires when you do something on the form. And
    then you have a query in an Access 2000 mdb, and I assume you have the
    same query in the Acces 2002 mdb. I can guarantee that something is
    missing from the Access 2000 mdb in the Acc2002 mdb. The question is
    what? For that we would need just a few more details about how your
    After_Update event is being fired. Like, what control on your form is
    firing this event? I will guess that it is a combobox field that is
    based on some query. It sounds like you are entering data on a form
    where you select the marriage status of a person from this combobox -
    like "single" - then the spousename field in the data entry form
    receives a Null value. If the value from the combobox is
    "Married-Living Together" then the After_Update event fires after the
    selection and an isnotnull flag is set. What is isnotnull? Is this a
    boolean variable? If it is just a text expression, try putting double
    (" ") quotations around it: "isnotnull" .


    Rich

    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    Working...