[AccessD] 64-but ONLY front end ?

Ryan W wrwehler at gmail.com
Fri Jan 6 15:48:08 CST 2017


Well good news. I took some of my most used forms and wrote a bit of logic
to clear out subform links when the tabs change.  I can now get much
"deeper" into the front end before I get a system resource message.
Probably deep enough it would really be an edge case at this point.

So that's nice.

Here's what I ended up calling to unlink all the subforms not in the
MyArray variant:

Public Sub UnlinkSubforms(MyFrm As Form, Optional MyArray As Variant = Null)
On Error GoTo UnlinkSubforms_Error

    Dim ctl As control, i As Integer

        For Each ctl In MyFrm.Controls
            Do
                Select Case ctl.ControlType
                    Case acSubform
                        'if array is null nothing was excluded
                        If Not IsNull(MyArray) Then
                            'loop through array
                            For i = 0 To Nz(UBound(MyArray), 0)
                                If ctl.Name = MyArray(i) Then
                                    Exit Do
                                End If
                            Next i
                        End If

                        'Set SourceObject empty if it's not empty
                        If ctl.SourceObject <> "" Then
                            ctl.SourceObject = ""
                            Debug.Print ctl.Name & " deactivated"
                        End If
                End Select
            Loop While False 'quit after one loop
        Next ctl


UnlinkSubforms_Exit:
    On Error GoTo 0
    Exit Sub

UnlinkSubforms_Error:
    MsgBox "Error " & Err.number & " (" & Err.Description & ") in procedure
UnlinkSubforms of Module FormAdjustments"
    Resume UnlinkSubforms_Exit

End Sub



So I run Call UnLinkSubForms(Me) to unlink them all. If I have one that
needs to stay "alive" due to another object depending on it being there I
change that to UnlinkSubForms(Me,Array("mySubFormName")).... or I can add
multiple subform names comma delimited.

I then use a select case after I unlink all the forms to relink the
subforms on the tab I want.

If I had to do it all over again from scratch I would make one subform for
the entire tabcontrol and then my actual linked subforms would be "all in
one" pages so I don't have to unlink multiple objects per tab, but just the
"parent" subform name.



On Fri, Jan 6, 2017 at 1:22 PM, Ryan W <wrwehler at gmail.com> wrote:

> I think I'm going to try dynamically unlinking subforms from their
> controls.  For the couple of the bigger forms I've made the tab control
> link/unlink on change I've saved almost 200MB off my Heap and Private data
> has another 70MB saved so far.
>
> I went from 1.3GB used (with these three forms open) to 1.099GB used.
>
> Now if I can figure out how to use a Select Case with an array so I can
> 'exclude' certain subforms from unlinking.....
>
>  Select Case LBound(MyArray) to UBound(MyArray) sadly doesn't work... but
> Select Case MyArray(0),MyArray(1) .. etc does. But that doesn't lend itself
> to be dynamic.
>
>
> On Fri, Jan 6, 2017 at 11:47 AM, James Button <
> jamesbutton at blueyonder.co.uk> wrote:
>
>> Crude - and maybe cruel to the dev and maintenance staff
>> But would it be possible to split the FE into 2 separate activity groups
>>
>> JimB
>>
>> -----Original Message-----
>> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
>> Ryan W
>> Sent: Friday, January 6, 2017 3:29 PM
>> To: Access Developers discussion and problem solving
>> <accessd at databaseadvisors.com>
>> Subject: Re: [AccessD] 64-but ONLY front end ?
>>
>> Hi Jim,
>>  I get the internal constraints. The constraint I'm running into the the
>> allowable usable Virtual Memory of a 32 bit process is 2GB. Once I hit
>> that
>> wall things crumble.   I don't believe I am hitting 2048 table ID's
>> limitation (and really, we only need 3 to 4 forms open most of the time)
>> ..
>> the test in a 64 bit VM with 64 bit Office where I opened so many forms
>> that my tab area had left/right arrows was just a test that I could
>> actually *do* that without getting a resources exceeded message (which I
>> can get readily on my own workstation just opening enough forms).
>>
>> I was hoping for another solution, as we have workstations here that use
>> our Access FE that are stuck on a 32 bit OS, which means we will lose
>> Access there (unless I continue to compile a 32 bit accde file) but then
>> they have to be wary of how many forms or objects they are working with
>> (which is the whole point of trying to fix this or move to 64 bit).
>>
>>  I'm not sure I can get any more mileage out of what we have!  I follow
>> most of the best practice rules for access.  I close objects and unset
>> ('nothing them') when they are no longer needed.  I don't allow
>> dimensioned
>> variables to use the default "variant" type but not explicitly declaring
>> it's type and variants are only used where explicitly set.
>>
>>   One area I could tweak (with a lot of work) would be unlinking subforms
>> from the tab control when that tab is not selected.  I do this in some
>> places but not all (I inherited thiscodebase)... which I am sure would
>> help
>> some but would require quite a bit of re-work since some tab controls have
>> multiple (small) subforms on them.
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
>


More information about the AccessD mailing list