Table Validation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    Table Validation

    Hi All,
    I have a small problem which I have so far been unable to solve. I am
    working on someone else's database which needs to ensure that certain fields
    are filled in if the value of other certain fields values are not null.

    Sounds simple enough however, I need to apply 2 validation rules to the same
    table.

    Both validation rules separately are:

    ([return or refused] Is Null) And ([vehicle spec] Is Null) And ([QC
    problem] Is Null) And ([late] Is Null) And ([DNA] Is Null) And ([mixed
    loads] Is Null) And ([extra deliveries] Is Null) And ([VCP's] Is Null)
    And ([barcode/swing ticket] Is Null) And ([box end label] Is Null) And
    ([set labels] Is Null) And ([shrouds] Is Null) And ([Boxes] Is Null) And
    ([hangers] Is Null) Or ([ref] Is Not Null)


    ([return or refused] is null) or [qty_refused_or_ returned] is not null)


    Is there a way I can combine the 2 together without having to re-design the
    database structure which I would prefer not to do?

    TIA,

    Mark



  • user_5701

    #2
    Re: Table Validation

    Depending on the number of the fields and the order of them (tab
    order) on the form, you could do an after update event that when one
    field (field0) is typed in, set the focus to the next field (field1),
    then do an after update (or maybe a different event, i forget which
    one) that when they try to leave that field (field1), it will check if
    it is null, and set the focus back to the field (field1) again, in
    essence, not letting them leave the field until it isn't null.

    That may be frustrating for your user(s) though. I'm sure someone
    else will probably have a better idea.

    What about setting the table so those fields don't allow nulls or zero
    length?


    "Mark" <mark.reed75@nt lworld.com> wrote in message news:<wM67d.12$ BO1.0@newsfe4-gui.ntli.net>.. .[color=blue]
    > Hi All,
    > I have a small problem which I have so far been unable to solve. I am
    > working on someone else's database which needs to ensure that certain fields
    > are filled in if the value of other certain fields values are not null.
    >
    > Sounds simple enough however, I need to apply 2 validation rules to the same
    > table.
    >
    > Both validation rules separately are:
    >
    > ([return or refused] Is Null) And ([vehicle spec] Is Null) And ([QC
    > problem] Is Null) And ([late] Is Null) And ([DNA] Is Null) And ([mixed
    > loads] Is Null) And ([extra deliveries] Is Null) And ([VCP's] Is Null)
    > And ([barcode/swing ticket] Is Null) And ([box end label] Is Null) And
    > ([set labels] Is Null) And ([shrouds] Is Null) And ([Boxes] Is Null) And
    > ([hangers] Is Null) Or ([ref] Is Not Null)
    >
    >
    > ([return or refused] is null) or [qty_refused_or_ returned] is not null)
    >
    >
    > Is there a way I can combine the 2 together without having to re-design the
    > database structure which I would prefer not to do?
    >
    > TIA,
    >
    > Mark[/color]

    Comment

    Working...