Conditional Macros

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

    Conditional Macros

    What condition do I need to use to stop a macro when no value is returned?
    In the querie there is no empty box, just the field names, and the form
    relating to it appears blank?

    I have various conditional macros in my DB to verify the integrity of the
    data. I set the repeat count high to make sure it completes, and put a
    condition that when a null value is returned from the query, usually in a
    form, the macro stops. This means even if I put a repeat count of 100 it
    will only repeat as many times as there are records to change.

    However, and this is my question, when some queries are completed, say one
    that looks for a null value in one table where there is a value in another,
    they show no value at all. This works fine in Access but when I put my
    tables on a server in SQL it doesnt read the blank form as a null, and
    repeats the full number of times.

    Hope someone can help,

    Stu



  • Allen Browne

    #2
    Re: Conditional Macros

    You could use:
    IsNull(DLookup( "MyIdField" , "MyQuery"))

    Looking up the primary key value returns null if there are no records in the
    query.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Stuart Round" <stuart.round1@ ntlworld.com> wrote in message
    news:9ei7d.830$ QQ1.0@newsfe3-gui.ntli.net...[color=blue]
    > What condition do I need to use to stop a macro when no value is returned?
    > In the querie there is no empty box, just the field names, and the form
    > relating to it appears blank?
    >
    > I have various conditional macros in my DB to verify the integrity of the
    > data. I set the repeat count high to make sure it completes, and put a
    > condition that when a null value is returned from the query, usually in a
    > form, the macro stops. This means even if I put a repeat count of 100 it
    > will only repeat as many times as there are records to change.
    >
    > However, and this is my question, when some queries are completed, say one
    > that looks for a null value in one table where there is a value in
    > another, they show no value at all. This works fine in Access but when I
    > put my tables on a server in SQL it doesnt read the blank form as a null,
    > and repeats the full number of times.[/color]


    Comment

    Working...