Jump to content

Lost Staff Number

From Prime 16 Online User's Manual

This runs any time a tile is clicked. New Code has no line number.

Behind Form mnuTouch

Sub TileAction(MyObject As String)
10        On Error GoTo p_err
       If IsBlank(pSnum) Or pSnum = 0 Then
           Call LostDefaults
       End If
20        Select Case MyObject
              Case "TAdd":
30                DoCmd.OpenForm "mnuSubTouch"

And behind the mnusubTouch

Public Function TextClick(TileSent As String)
550       On Error GoTo p_err
          'MsgBox TileSent
       If IsBlank(pSnum) Or pSnum = 0 Then
           Call LostDefaults
       End If
560       Crit = "Select * from subTouch Where ObjectDescription = """ & TileSent & """"
570       Set mydb = DBEngine.Workspaces(0).Databases(0)
580       Set myrs = mydb.OpenRecordset(Crit, dbOpenDynaset, dbSeeChanges) 'New Recordset Closed

In the module basRibbonCallbacks, make this change (around line 300):

'Runtimetest
          
          If isLoaded("mnuMainMenu") Then
                If pSnum = Null Or pSnum = 0 Then
                    Call LostDefaults
                End If
          End If

The If psnum part was remarked out. I added the wrapper looking for whether mnuMainMenu is loaded. It seems to run in RunTime mode.