Solved Bound ole frame does not show contents in Windows 11 (1 Viewer)

JohnPapa

Registered User.
Local time
Today, 18:44
Joined
Aug 15, 2010
Messages
647
I have some very old code that populates a number of Bound ole frames, which suddenly has stopped working in Windows 11.

The critical code is the last two statements at the end

strDum = "Ole" & lngCounter & "1"
frm(strDum) = rst!oleBMP

frm is passed as a parameter "frm As Form"
strDum = "Ole181" ' Where Ole181 = name of Ole container
rst!oleBMP is the specific BMP where oleBMP is of Type OLE Object in tblBMPs




Code:
Dim lngCounter As Long
Dim db As Database
Dim rst As Recordset
Dim rstTemp As Recordset
Dim strCriterion As String
Dim strDum As String
Dim strDum2 As String  'Holds 3 character from txtTeethStatusCurrent
Dim lngDum2 As Long  'Holds the converted strDum2 to a long number

Set db = CurrentDb
Set rst = db.OpenRecordset("tblBMPs", dbOpenDynaset)

'*************************************************
'Handle Teeth 11-18. Will step through first 8 6's of txtTeethStatusCurrent
For lngCounter = 18 To 11 Step -1
'Step first through the second 3 characters of each 6-character group
  Select Case strCOS
    Case "C"
      strDum2 = Mid(frm!txtTeethStatusCurrent, ((19 - lngCounter) * 6) - 2, 3)
    Case "O"
      strDum2 = Mid(frm!txtTeethStatusOriginal, ((19 - lngCounter) * 6) - 2, 3)
    Case "S"
      strDum2 = Mid(Forms!frmDentalInfo!subEstimate.Form!txtTeethStatusSchedule, ((19 - lngCounter) * 6) - 2, 3)
  End Select

  lngDum2 = Val(strDum2) + (lngCounter * 10000) + 1000
  strCriterion = "lngBMPID = " & lngDum2
    'Locate the appropriate entry in tblBMPs
  rst.FindFirst strCriterion
  If rst.NoMatch Then
        'MsgSub (30074)
  Else
    strDum = "Ole" & lngCounter & "1"
    frm(strDum) = rst!oleBMP
  End If
 
Last edited:

JohnPapa

Registered User.
Local time
Today, 18:44
Joined
Aug 15, 2010
Messages
647
By not working I mean it gives no error but does not place the .bmp in the ole container.

It goes through the code, but basically does nothing.
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,388
I don't have Windows 11 but I've read this is related to how the MS Paint app works
Anyway, this is a known issue and apparently can be fixed by changing a registry setting. See

This page may be worth bookmarking as well:

However, OLE is very old technology. Maybe a good time to move to using image controls
 

JohnPapa

Registered User.
Local time
Today, 18:44
Joined
Aug 15, 2010
Messages
647
Hi Isladogs and many thanks for providing a solution to the problem. Changing Ole to Image is a task for the future.

As mentioned in the link you sent over, the problem seems to arise with the changes made to MSPaint with Windows 11. Paint was always
the OLE server for (bitmap) images in Access/Windows and the new App version of MSPaint in Windows 11 doesn't appear to have the OLE server
ability, so Access can't display the image.

The problem is solved with a transfer of the registry entries for Bitmap Image from Windows 10 to Windows 11. The attached zip file contains 4 of the entries (maybe not all 4 are required)
 

Attachments

  • Paint_OLE_RegistryKeys.zip
    2.5 KB · Views: 208

bam65y

New member
Local time
Today, 16:44
Joined
Jul 7, 2022
Messages
2
Hi Isladogs and many thanks for providing a solution to the problem. Changing Ole to Image is a task for the future.

As mentioned in the link you sent over, the problem seems to arise with the changes made to MSPaint with Windows 11. Paint was always
the OLE server for (bitmap) images in Access/Windows and the new App version of MSPaint in Windows 11 doesn't appear to have the OLE server
ability, so Access can't display the image.

The problem is solved with a transfer of the registry entries for Bitmap Image from Windows 10 to Windows 11. The attached zip file contains 4 of the entries (maybe not all 4 are required)
Hi. I've applied the 4 registry files which appears to fix the display of existing objects, but when attempting to add a new bitmap it is importing it as a package which won't display the contents. If I right click on the control and select Activate Contents it opens up in Photos, not Ms Paint. I'm guessing there are some additional registry entries that need to be set. Any ideas?

1657159983136.png
 

JohnPapa

Registered User.
Local time
Today, 18:44
Joined
Aug 15, 2010
Messages
647
Hi. I've applied the 4 registry files which appears to fix the display of existing objects, but when attempting to add a new bitmap it is importing it as a package which won't display the contents. If I right click on the control and select Activate Contents it opens up in Photos, not Ms Paint. I'm guessing there are some additional registry entries that need to be set. Any ideas?

View attachment 101707
The initial problem was with OLE containers.

I have no problem importing bitmap images, into existing OLE containers.
 

bam65y

New member
Local time
Today, 16:44
Joined
Jul 7, 2022
Messages
2
I found another website with a different set of registry entries that added bitmap to the supported list of object types. The site is in German but the solution there addressed the issue I was experiencing. Don't know why but the site wouldn't let me add the full url but here is the latter part of the url : - ms-office-forum.net/forum/showthread.php?t=377820 - still works when I use the truncated link in Chrome
 

Users who are viewing this thread

Top Bottom