[AccessD] C2DbWakeupCall.mdb

jwcolby jwcolby at colbyconsulting.com
Fri Jan 25 00:30:43 CST 2008


Try changing the sub to a function? 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of pcs at azizaz.com
Sent: Friday, January 25, 2008 12:28 AM
To: Access Developers discussion and problemsolving
Subject: [AccessD] C2DbWakeupCall.mdb

This one is for Mr Colby:

Hi John,
Had a look at C2DbWakeupCall.mdb

Whereas I can get notepad to kick in (Yes!) I have problems getting a public
sub or function in the mdb to do the same....

Your function that makes the process kick in looks like
this: 
Function Run(lstrProcessName) As Boolean Dim lngProc As Long
    'Hasn't run today so check if the time is > mdetTimeToRun
    If Time() > mdteTimeToRun Then
        If Date > mdteLastRan Then
            'Mark mdteLastRun = Now()
            mdteLastRan = Date
            '
            If mblnRunCommand Then
                lngProc = WinExec(mstrProcessName, 1)
            End If
            'and return true
            lstrProcessName = mstrProcessName
            Run = True
        End If
    End If
End Function

I changed the follwing section to:

            If mblnRunCommand Then
                lngProc = WinExec(mstrProcessName, 1) 'added
            Else
                Eval (mstrProcessName & "()") 'end added
            End If

thinking that if the tickbox on the form (mblnRunCommand) has not been
ticked, and in the text control on the form I add the name of a public sub
or function, that procedure should start running.... but it don't!!

mstrProcessName is  "bshTest" which is

Public Sub bshTest()
MsgBox "Hello Universe?", vbQuestion + vbOKCancel End Sub

The error is 2425 : The expression you entered has a function name that
Microsoft Office can't find.

What am I missing?

Regards
borge
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list