Hello,
I have a query that makes a table of tickets not assigned to our
technicians. If the table has tickets in it, I want the macro to launch a
program, which I think I can do. The problem I have is if the table is empty
the program still trys to assign and logs that it did assign. I need help.
What I would like to do is have some code that checks to see if the table is
empty, if it is I want it to stop there, if has a count >1 then I would like
for it to launch a macro. Anybody have any idea how I should code this?
Thanks.
Wayne Morgan - 18 Feb 2005 14:29 GMT
Try the DCount function.
If DCount("*", "[MyTable]") > 0 Then
'Run Program Here
End If

Signature
Wayne Morgan
MS Access MVP
> Hello,
> I have a query that makes a table of tickets not assigned to our
[quoted text clipped - 9 lines]
> for it to launch a macro. Anybody have any idea how I should code this?
> Thanks.
Nikos Yannacopoulos - 18 Feb 2005 14:31 GMT
Brent,
If you are doing the work through a macro, then insert a StopMacro
action at the very top, with condition:
DCount("*","TableName") >= 1
so the macro will abort if no record is found in the table.
HTH,
Nikos
> Hello,
> I have a query that makes a table of tickets not assigned to our
[quoted text clipped - 5 lines]
> for it to launch a macro. Anybody have any idea how I should code this?
> Thanks.
Brent Sweet - 18 Feb 2005 14:49 GMT
This sounds exactly like what I need, however where do I put in this condition.
> Brent,
>
[quoted text clipped - 17 lines]
> > for it to launch a macro. Anybody have any idea how I should code this?
> > Thanks.
Steve Schapel - 18 Feb 2005 18:11 GMT
Brent,
In your macro design window, if you do not see a Condition column, then
select Conditions from the View menu.
If you are going to apply Nikos's isea, of using a StopMacro action, I
think the Condition would be...
DCount("*","TableName")=0

Signature
Steve Schapel, Microsoft Access MVP
> This sounds exactly like what I need, however where do I put in this condition.