if docmd.runcode functionVariable was allowed, I would be set....
Public Function Do_This(My_Thing As String, My_Type As String)
Select Case UCase(My_Type)
Case "FORM"
DoCmd.OpenForm My_Thing, acNormal, , , acFormEdit, acWindowNormal
...
Case "REPORT"
DoCmd.OpenReport My_Thing, acViewPreview
Case "CODE"
docmd.runcode My_Thing
..
Here is the rub. Docmd.runcode is not allowed...
No but Application.Run is...
>I'd like to indirectly reference a function...
>
>if docmd.runcode functionVariable was allowed, I would be set....
>
>
>Public Function Do_This(My_Thing As String, My_Type As String)
> Select Case UCase(My_Type)
>
> Case "FORM"
> DoCmd.OpenForm My_Thing, acNormal, , , acFormEdit, acWindowNormal
> ...
>
> Case "REPORT"
> DoCmd.OpenReport My_Thing, acViewPreview
>
>
> Case "CODE"
> docmd.runcode My_Thing
>..
RunCode is a macro action so it is inappropriate in a VBA
procedure.
Help on the Run method is pretty complicated, but I think
you can get away with using:
Application.Run My_Thing
--
Marsh
MVP [MS Access]
Marshall Barton wrote:
>>I'd like to indirectly reference a function...
>>
>[quoted text clipped - 14 lines]
>> docmd.runcode My_Thing
>>..
>
>RunCode is a macro action so it is inappropriate in a VBA
>procedure.
>
>Help on the Run method is pretty complicated, but I think
>you can get away with using:
>
> Application.Run My_Thing
>
--
Microsoft Access and Office Integration Experts
www.tabengineering.com
in...@abetterdatabase.com