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

JohnPapa

Registered User.
Local time
Today, 10:58
Joined
Aug 15, 2010
Messages
620
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, 10:58
Joined
Aug 15, 2010
Messages
620
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, 08:58
Joined
Jan 14, 2017
Messages
16,241
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, 10:58
Joined
Aug 15, 2010
Messages
620
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: 162

Users who are viewing this thread

Top Bottom