dbTalk Databases Forums  

Conditional Macros

comp.databases.ms-access comp.databases.ms-access


Discuss Conditional Macros in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stuart Round
 
Posts: n/a

Default Conditional Macros - 10-01-2004 , 02:29 PM






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




Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Conditional Macros - 10-01-2004 , 11:08 PM






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 (AT) ntlworld (DOT) com> wrote

Quote:
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.