Re: Run a macro and code from the same event?



Ok, This is what Im doing. I running a macro on the On Current event of my
form frmBusiness. If a condition is true it sets enabled to false on several
controls. If the condition is false it sets enabled to true on the same
controls. This is the macro;

Condition: ([Forms]![frmAddress]![frmBusinessSubform].[Form]![AddressID]) Is
Null

Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![AddressID].
[Enabled] Expression: Yes
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessID].
[Enabled] Expression: No
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessPhone].
[Enabled] Expression: No
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessName].
[Enabled] Expression: No

Condition: ([Forms]![frmAddress]![frmBusinessSubform].[Form]![AddressID]) Is
Not Null

Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![AddressID].
[Enabled] Expression: Yes
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessID].
[Enabled] Expression: Yes
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessPhone].
[Enabled] Expression: Yes
Set Value: [Forms]![frmAddress]![frmBusinessSubform].[Form]![BusinessName].
[Enabled] Expression: Yes

The macro works just like I want it to. The problem is that now I want to add
a procedure to the On Current event. The procedure replaces the navigation
Record x of y. I have a label on my form that is called lblNavigation. I dont
know how to add a procedure to the event after I already have a macro on the
same event. This is the procedure;

Private Sub Form_Current()
If Me.NewRecord Then
Me!lblNavigate.Caption = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblNavigate.Caption = "Record " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If
End Sub

Is there an easy way to add a procedure to an event when you are already
running a macro?

Thanks for the help.

Tom



Ken Snell [MVP] wrote:
>Let's start at the beginning. What is your macro doing right now? On which
>event is it being run? Tell us what you are wanting to do.... we then can
>suggest a reasonable approach.
>> Is there a way to turn my code into a macro? Im much better with macros.
>>
>[quoted text clipped - 16 lines]
>>>>>>>>
>>>>>>>> Tom

--
Message posted via http://www.accessmonster.com
.