Run code from macro

E

EdHaddock

I have a need to run the following code from a macro:

Private Sub Combo14_AfterUpdate()

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ProjectName] = '" & Me![Combo14] & "'"
Me.Bookmark = rs.Bookmark

End Sub

Can this be converted to a macro or can it be run from an existing macro? Any
help is appreciated. Thanks Ed
 
S

Steve Schapel

Ed,

There is not direct equivalent to this code in a macro.

You could replace it with a macro like this:
Action: GoToControl
Control: [ProjectName]
Action: FindRecord
Find What: =[Combo14]

An alternative would be to write the code as a Function, and then you
could use the RunCode action in a macro.

I am curious why you want to run VBA procedure with a macro, seems very
unusual and I can't think of a scenario when you would need this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top