Heenan, Lambert
Lambert.Heenan at AIG.com
Fri Feb 16 10:53:21 CST 2007
You open the macro in design view, and from the View menu select
"Conditions". In the conditions column you can then type
CheckReferences() = False
If that statement is true all the macro action on that line will execute
In other words to convert
If SomeCondition() Then
DoSomething
DoSomethingElse
Else
DoADiffferentThing
Endif
To a macro it would look like
Condition : Action
=====================================
SomeCondition()=True : DoSomething
SomeCondition()=True : DoSomethingElse
SomeCondition()=False : DoADiffferentThing
Note that each statement in the True part of the IF needs a condition,
otherwise the DoSomethingElse part would execute every time, regardless of
what the result of SomeCondition() was.
HTH
Lambert
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Friday, February 16, 2007 11:23 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Missing references
Thanks Gustav,
This is almost embarrassing...I see the code...I know what the code does...I
can write VBA...ALL...DAY...LONGGGG...But I don't know how to convert your
IF statement back to a macro??? lol...Not sure why but I find this fact
amusing, but I do. Here is the VBA/Macro...
<macro>
'------------------------------------------------------------
' AutoExec
'
'------------------------------------------------------------
Function AutoExec()
DoCmd.Echo False, ""
If (CheckReferences() = False) Then
Call VerifyReferences(True)
DoCmd.OpenModule "USysReferencesCheck", ""
DoCmd.RunCommand acCmdCompileAndSaveAllMod
DoCmd.Close , ""
End If
DoCmd.Echo True, ""
End Function
</macro>
I got the echo part...lol...but how do you do the if statement?
Thanks,
Mark A. Matte
>From: "Gustav Brock" <gustav at cactus.dk>
>Reply-To: Access Developers discussion and problem
>solving<accessd at databaseadvisors.com>
>To: <accessd at databaseadvisors.com>
>Subject: Re: [AccessD] Missing references
>Date: Fri, 16 Feb 2007 00:03:43 +0100
>
>Hi Mark
>
>Some years ago we had a lengthy thread on this.
>Look up here:
>
>http://databaseadvisors.com/pipermail/accessd/2003-July/011034.html
>
>/gustav
>
> >>> markamatte at hotmail.com 15-02-07 23:02 >>>
>Thanks John,
>
>I'm not referencing any other app or docs...I was referring to when you
>are in a module and goto TOOLS---REFERENCES...and there is something
>missing or incorrect.
>
>Is binding relevant at this point? If not...back to the original
>question:...how to handle the 'missing'???
>
>Am I still confused>..lol...???
>
>
>Thanks,
>
>Mark A. Matte
>
>--