?
Solved

Missing ActiveX Control ??

Posted on 2006-07-13
11
Medium Priority
?
2,516 Views
Last Modified: 2016-08-29
I will appreciate any help in figuring out any ACTIVE X control I may be missing here.

I have recently re-installed, Microsoft Access 2003. After installation I opened my db and  suddenly discovered my switchboard code displaying

compile error - Run-time error '438':
"Object support this object of property method.

on...

      .Redraw = False

from the code below:

' ..........................
' .........................
 If gfDebug Then
      'Print some info to the debug-window
      rsItems.MoveLast: rsItems.MoveFirst
      Debug.Print GetUserLogon & " (" & getUserLevel & " / " & getUserLevel_Title & "): " & _
         rsItems.RecordCount & " item(s) accessible"
   End If
         .Redraw = False

   With vsfg
      mfSkip_RowColChange = True
      .Redraw = False                                                                  ' <<<------ Error line.
      .Clear
      .Rows = 0: .FixedRows = 0: .Cols = 4: .FixedCols = 0
      .ExtendLastCol = True
      .OutlineBar = flexOutlineBarSimpleLeaf 'flexOutlineBarSymbolsLeaf flexOutlineBarComplete
      .GridLines = flexGridNone
      .AutoSearch = flexSearchFromCursor
      .ScrollTrack = True
      .AllowSelection = False 'no selection of more than a single cell!
      .AllowBigSelection = False
      .SelectionMode = flexSelectionByRow ' flexSelectionFree
      .AllowUserResizing = flexResizeNone
      .Ellipsis = flexEllipsisEnd
      .HighLight = flexHighlightAlways 'flexHighlightWithFocus
      .FocusRect = flexFocusLight ' flexFocusSolid ' flexFocusNone
      .MergeCells = flexMergeNever
      '.TreeColor =
     
      .ColWidth(0) = 0        '1st Column:   Item-ID (as in L_tbl_Switchboard_Items)
      .ColWidth(1) = 0        '2nd Column:   Whether or not a node contains children
      .ColWidth(2) = 0        '3rd Column:   Descriptive text that is being shown in the
                              '              Switchboard's right section
      .ColWidth(3) = 400      '4th Column:   Caption being shown in the treeview
      .OutlineCol = 3
     
      'Add the "Home"-node
      vsfg.AddItem "0" & vbTab & "" & vbTab & "" & vbTab & "Home"
      vsfg.IsSubtotal(0) = True

      With rsNodes
         'Default: Add all items
         fAdd = True
         
         'Loop through all switchboard-items, adding them to the treeview
         While Not .EOF
            'Assemble a key for this node, consisting of four arguments:
            '
            '  1. The ID - required to find a child-node's parent
            '  2. Whether or not this is a node with items on it (True=Items present, False=None)
            '  3. A node's description, to be shown in the SB's top-label
            'If !SB_ID = 9 Then Stop
            rsItems.FindFirst "SI_ParentID = " & CStr(!SB_ID) & " AND SI_MinPermissionLevel >= " & CStr(lngAccessLevel)
            strItem = !SB_ID & vbTab & CStr(Not rsItems.NoMatch) & vbTab & !SB_NodeDescription & vbTab & !SB_NodeTitle
           
            If rsItems!SI_Requires_AllowChangingBE Then
               'Additionally check whether the current user has an active AllowChangingBE-flag
               fAdd = getUserFlag_AllowChangingBE
            End If
           
            If fAdd Then
               If !SB_Parent > 0 Then
                  'This node is a child-node of some other node;
                  'Find the parent node and add it below that node's last child
                  lngRow = getNodeIndex(!SB_Parent) + 1
                  vsfg.AddItem strItem, lngRow
                  vsfg.IsSubtotal(lngRow) = True
                  vsfg.RowOutlineLevel(lngRow) = vsfg.RowOutlineLevel(lngRow - 1) + 1
               Else
                  'There is no parent - add this node to the treeview's root (being the Home-node)
                  vsfg.AddItem strItem
                  vsfg.IsSubtotal(vsfg.Rows - 1) = True
                  vsfg.RowOutlineLevel(vsfg.Rows - 1) = vsfg.RowOutlineLevel(0) + 1
               End If
            End If
           
            .MoveNext
         Wend
      End With
     
      .RowHeight(-1) = 350
      .Row = 0
   End With

   '*** Bill:
   'While adding nodes, there might be branches without any children due to the fact that the current user
   'may not access any object on that hierarchy-level.
   'Hence, remove all nodes that have neither children nor a value within the Object-Type (making them parent-nodes)
   For lngCounter = vsfg.Rows - 1 To 1 Step -1
      'Debug.Print "Row " & lngCounter & ": " & Replace(vsfg.Cell(flexcpText, lngCounter, 0, lngCounter, 3), vbCrLf, "")
      If vsfg.GetNodeRow(lngCounter, flexNTFirstChild) < 0 _
            And (Not CBool(vsfg.TextMatrix(lngCounter, mconTV_Col__1_HasChildren))) Then
         vsfg.RemoveItem lngCounter
      End If
   Next lngCounter
   
   'Add an Exit-entry to the tree (last item);
   'See the vsfg_RowColChange-sub to learn how this is used!
   vsfg.AddItem "0" & vbTab & "" & vbTab & "" & vbTab & "Exit"
   vsfg.RowOutlineLevel(vsfg.Rows - 1) = 1
   vsfg.IsSubtotal(vsfg.Rows - 1) = True
   
   vsfg.Redraw = True
   ShowPage True
   
   'Clean up
   Set rsNodes = Nothing
   Set rsItems = Nothing
   mfSkip_RowColChange = False
   vsfg_RowColChange
End Sub
0
Comment
Question by:billcute
11 Comments
 
LVL 35

Expert Comment

by:Raynard7
ID: 17105017
I have read through this; the problem seems to be with
vsfg

You have not included in your code what sort of object vsfg is - if you can determine this then that is what is required - once we can determine that  - go to references and add the correct reference to the control.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 17105496
in this part of the code:

If gfDebug Then
      'Print some info to the debug-window
      rsItems.MoveLast: rsItems.MoveFirst
      Debug.Print GetUserLogon & " (" & getUserLevel & " / " & getUserLevel_Title & "): " & _
         rsItems.RecordCount & " item(s) accessible"
   End If
         .Redraw = False

what does the .Redraw = False refer to, as it appears to be outside any valid With...End With block.

the syntax

.<property> = Value

can ONLY be used within a

With


End With

block, and I don't see one the encloses the

.Redraw = False

line of code.

You immediately follow the offending line with a new

With...End With block , refering to the variable

vsgf, where you indicate the error occurs.  What kind of object is vsfg?  And does that class in fact have a Redraw property?

AW



0
 
LVL 4

Author Comment

by:billcute
ID: 17106903
To Experts,
The code behind my Switchboard that are relevant to this topic is too long..so I have decided to upload the sample.

Unfortunately, I have problems with the upload as such I have requested CS for assistance. The link to my uploaded file will; be availbale as soon as CS acted on it.

Regards
Bill
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
LVL 65

Expert Comment

by:rockiroads
ID: 17106952
Bill, in vba window, go to Tools/References

do u see any references listed as broken


Now on design view of your switchboard form, go to the activex control and look at the properties for that

What is the OLE CLass
and what is in Class
they sound the same but are two seperate properties
0
 
LVL 4

Author Comment

by:billcute
ID: 17107090
rockiroads,
There is no broken reference and no reference to an OLE Class on the design of the form.

However the design shows:

Picture = (none)
Picture Type = Embedded
Picture Size mode = Clip

Regards
Bill
0
 
LVL 4

Author Comment

by:billcute
ID: 17107129
I tried importing the switchboard form to a new db...and I am getting this error:

"There was an error loading an ActiveX Control on one of your forms or report....but when I check the Reference Library - nothing was missing.

Regards
Bill
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1000 total points
ID: 17107192
Thats not an ActiveX control is it? thats just a image control. This is what Access puts for unknown/unregisterd Active X controls.


Taking an educated guess, were you using some kind of grid? something like a MSFlexGrid?

If so then what I suggest u do is this

Go to vba window, go to Tools/References
click on Browse
select filetype OCX
find msflxgrd.ocx
click OK
it should come back with Microsoft Flexgrid Control checked

There is another flexgrid control, but Im hoping its this one
0
 
LVL 4

Author Comment

by:billcute
ID: 17107381
I searched for Msflxgrd.ocx, in my OS system - there was none.

However, the following files are the registered OCX for the Switchboard. They are registered however
as:
ComponentOne VsFlexgrid 8.0 (Light)

registered files:
vsflex8l.ocx
VSFLEX3.OCX



Regards
Bill
0
 
LVL 39

Assisted Solution

by:stevbe
stevbe earned 1000 total points
ID: 17107410
ok ... open references, uncheck any reference, close references, open references and re-select what you just unselected. I have seen this type of behavior on upgrades, re-installs etc. make sure you close the references between unselect and re-select.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17107556
Thats the one, thats the grid control you are using. I took an educated guess reading your code and thought it looked like grid controls

Since u say u do not have any listed as MISSING, u can try this
Is it already checked? if so, just uncheck and recheck like Steve as mentioned
Or uncheck
Now you dont have it or u have just unchecked it
What u do is follow the instructions I gave earlier but this time look for VSFLEX8l.ocx

You have 2 files, I think 8 must be a later version that 3

0
 
LVL 4

Author Comment

by:billcute
ID: 17113946
stevbe / rockiroads,
CS finally sent me the link to my sample for posting this morning. However, the link is no longer required as both of your suggestions helped in resolving the problem. I got the Switchboard running again.

I will be splitting the points.

Regards
Bill
0

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
With the functions here, you can parse, convert, and format back and forth between feet and inches and fractions and decimal inches - for normal as well as extreme values and with extreme precision.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question