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
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: