Conditions In Macros

katmando

Registered User.
Local time
Today, 09:59
Joined
Dec 20, 2005
Messages
12
Hello All
I've got a macro that runs a load of individual querys, I want to be only run the querys if a value in a particular table is above a cetain value The table that holds this value has only one cell.

I have tried the following condition ("[tbltest2]","sumofexpr1")>8

But this does not seem to work. Is it possible to base this condition by looking at one cell in a table? This figure comes from summing a column in another table, so could use a sum function, but again have not been able to get this to work

Thanks
K
 
katmando said:
The table that holds this value has only one cell.

I have tried the following condition ("[tbltest2]","sumofexpr1")>8
Don't wanna lecture you but , tables do not have cells, they have fields.

Make a query based on your table which looks something like :

Code:
SELECT Yourtable.yourfield
FROM Yourtable
WHERE (((Yourtable.yourfield)>8));

Hope this helps.
 
Thanks for that,, but how does this query fit into the condition field of the macro?
 
The code I gave you, is the query in SQL view, not a macro.
So first design the query and than insert Openquery in the macro action list.

Hth
 
I think you have to use DLOOKUP ini the macro condition field:
8<DLOOKUP("ColumnName","TableName","Criteria")
Then if it is true it will run the macro statement, false will bypass it.
 

Users who are viewing this thread

Back
Top Bottom