gINT Rules throws error at CallByName

I am beginner learning the gINT Rules .

I am trying follow with the GR001 tutorial at page 97 (Code Samples) First Iteration in the book and apply it against a simple trial code project to see if I could get a sample text placed in the grid. 

I have a table as shown in the image.. 

I have the following rules code [copy and pasteed from gr001 example but with my field and table names] and what I thought were assignment statements in that gr001:

Option Explicit


'Commonly used field names
Public Const gs_Depth As String = "Depth"
Public Const gs_HoleDepth As String = "HoleDepth"
Public Const gs_PointID As String = "PointID"

Public glNumRows As Long
Public gsDataA() As String



Public Function InitFieldsFnB(ParamArray pvFieldsV() As Variant) As Boolean
'*****************************************************
'05Aug2003 sc
'Description:
'  Determine the positions of fields in the data array.
'  If any or not found, report the missing field or fields and abort further
'  code execution.
'Input:
'  pvFieldsV():  Elements 0, 2, 4,... are the field names.
'Output:
'  pvFieldsV():  Elements 1, 3, 5,... are the field positions.
'Returns:
'  True if fields were not found, False if all were found.
'*****************************************************
  Const s_FieldSeparator As String = ", "

  Dim iInd As Integer
  Dim iPsField As Integer

  Dim sMissingFields As String
  '------------------

  InitFieldsFnB = False
  sMissingFields = ""
  With gINTRules.GridData
    For iInd = 0 To UBound(pvFieldsV) Step 2
      iPsField=.FieldCol(CStr(pvFieldsV(iInd)))
      If iPsField Then
        pvFieldsV(iInd + 1) = iPsField
      Else
        sMissingFields = sMissingFields & _
                         s_FieldSeparator & _
                         pvFieldsV(iInd)
      End If
    Next iInd

    If Len(sMissingFields) Then
      sMissingFields = _
        Mid$(sMissingFields, Len(s_FieldSeparator) + 1)
      MsgBox "The following field(s) are missing " & _
             "from this table." & vbCrLf & _
             Space$(5) & sMissingFields & vbCrLf & _
             "Cannot perform the save checks " & _
             "and calcs without it/them." & vbCrLf & _
             "Data will be saved as-is.", _
             vbOkOnly, "Field Checking"
      InitFieldsFnB = True
    End If
  End With
End Function

'#LibInclude "Common"

Option Explicit

Public Sub Main
  With gINTRules.GridData
    'Put the grid data into a working string data array.
    gsDataA=.DataArray
    glNumRows = UBound(gsDataA, 2)
    CallByName Me, gINTRules.ProcedureName, vbMethod

    'Put the modified data array back into the input grid.
    .DataArray=gsDataA

    'Success is True if there were no errors.
    gINTRules.Success=CBool(.ErrorCol=0)
  End With
End Sub


Public Sub Laboratory



Dim iPsDepth As Integer
Dim iPsConfining_Pressure As Integer
Dim iPsDeviator_Stress As Integer
Dim iPsMoisture_Content As Integer
Dim iPsLiquid_Limit As Integer
Dim iPsPlasticity_Index As Integer
Dim iPsWet_Density As Integer
Dim iPsComments As Integer
Dim iPsPP As Integer
Dim iPsM200 As Integer
Dim iPsLab_Tech_Description As Integer

Dim lRow As Long



        With gINTRules.GridData

        iPsDepth = .FieldCol("Depth")
        iPsConfining_Pressure = .FieldCol("Confining Pressure")
        iPsDeviator_Stress = .FieldCol("Deviator Stress")
        iPsMoisture_Content = .FieldCol("Moisture Content")
        iPsLiquid_Limit = .FieldCol("Liquid Limit")
        iPsPlasticity_Index = .FieldCol("Plasticity Index")
        iPsWet_Density = .FieldCol("Wet Density")
        iPsComments = .FieldCol("Comments")
        iPsPP = .FieldCol("PP")
        iPsM200 = .FieldCol("-200")
        iPsLab_Tech_Description = .FieldCol("Lab Tech Description")


          For lRow = 1 To glNumRows
          
          'just trying to put the text into the Comments Field
          gsDataA(iPsComments, lRow) = "Test Data"
          Next lRow
        End With
       End Sub






The Tables are shown in the screen grab


Click image to get it to expand to show the fields I am working with ...

The error is in the line "CallByName Me, gINTRules.ProcedureName, vbMethod"   .. when I try to run the code it says "(10091) ActiveX Automation: no such property or method. No Pre- or Post-process code specified for table LABORATORY"

Am I missing some hidden fields or key fields Do I need Point ID? Confused as to why it breaks. Also Dont think I need the field names check function at this point, right?

Maybe I need a gINTRules.GridData.DataValue (Col, Row) = "My testing text here"???

Parents
  • Hi Art,

    Check to make sure that you have set the References correctly for your Common Procedures module.

    Select the gINT Rules Code command.

    Select your "common" procedures module from the List tab.

    Then, click on the Code tab followed by the References command from the Edit menu.

    Make sure that you have selected the correct DAO (Access Database Engine Object) library for the version of Microsoft Office installed on your computer.

    For example, I ran MS Office 2003 for many years on a Windows 7 system and I would need to select "Microsoft DAO 3.6 Object Library (5.0).

    Now I am running MS Office 365 (Office 16) on a Windows 10 system and I need to select "Microsoft Office 16.0 Access Database Engine Object Library (c.0)".

    Hope that helps get you further along.

    Regards,

    Dave

Reply
  • Hi Art,

    Check to make sure that you have set the References correctly for your Common Procedures module.

    Select the gINT Rules Code command.

    Select your "common" procedures module from the List tab.

    Then, click on the Code tab followed by the References command from the Edit menu.

    Make sure that you have selected the correct DAO (Access Database Engine Object) library for the version of Microsoft Office installed on your computer.

    For example, I ran MS Office 2003 for many years on a Windows 7 system and I would need to select "Microsoft DAO 3.6 Object Library (5.0).

    Now I am running MS Office 365 (Office 16) on a Windows 10 system and I need to select "Microsoft Office 16.0 Access Database Engine Object Library (c.0)".

    Hope that helps get you further along.

    Regards,

    Dave

Children