idefaz
6 years ago
the iGrid objects in my databases are extremely large. Anyone know how i can refresh whatever it is that's causing this?

If i make a copy of the database, delete the iGrid objects in a form then compact and repair i see anywhere from 30mb to 100mb file size reduction.
Igor/10Tec
6 years ago
iGrid is a visual control but not a thing that stores data. As such, it should not be very big in size, especially if we talk about tens of megabytes.

Perhaps, your form is corrupted and you need to recreate it to fix this issue.
idefaz
6 years ago
Think i could send you a file where this is happening? It will randomly happen while coding. The file size will jump by like 50mb per iGrid object in the form. When this happens i just delete the iGrid objects and put new ones in, then compact and repair. Now that i have a work around it's kind of just annoying. Although before i figured it out it was crashing access, losing work, etc..

Here is the code i use to format the iGrid on load.

Private Sub grdSetup(cgrd)
    ' format iGrid
    If ErrCatchOn Then On Error GoTo Grr
    Dim grd As iGrid
    Set grd = cgrd
    Dim m As Variant

    m = GetDpi

    Set cgrd.BackgroundPicture = LoadPicture(Application.CurrentProject.path & "\bg.jpg")

    With grd
        .BeginUpdate

        .RowMode = True
        .Editable = False

        .Font.Name = "Consolas"
        .Font.Size = 20
        .ForeColor = vbWhite

        .GridLines = igGridLinesHorizontal

        .header.UseXPStyles = False
        .header.BackColor = vbActiveBorder
        .header.ForeColor = vbBlack
        .header.Font.Name = "Consolas"
        .header.Font.Size = 14
        .header.Height = 30 * m
        .header.Flat = True

        .EndUpdate
    End With

    Set grd = Nothing

GrrExit:
    Exit Sub
Grr:
    MsgBox Err.Description
    Resume GrrExit
End Sub
Igor/10Tec
6 years ago
Oh, now I see you are loading a picture bg.jpg. What is the size of this file? Try to use iGrid without this custom background picture and tell us whether your problem is gone.

We have never heard about the issue you reported earlier. Perhaps, it occurs because of the picture you load. I think so because I can't recall that anyone from our customers used background pictures for iGrid in Access forms before. If it is true, then the problem somewhere on the side of MS Access because binary big data are stored in form resources by this dev env, not by iGrid.

BTW, you can also experiment with forms without iGrid. Does your problem occur if you load your bg.jpg with the LoadPicture function then?
idefaz
6 years ago
image is 662KB. It is fine for a time during development. It seems to occur when i have the form open and i'm altering code (after a few saves).

I've attached a database with all links and code deleted. The only thing is one form and the weird state of the iGrid object. file is 14 mb (zipped less than 1mb).   example.zip (878kb) downloaded 43 time(s).
Igor/10Tec
6 years ago
Sorry, but this database didn't help. If you say that the db increases in size when you switch to code editing, then the problem is definitely not on the side of iGrid.

BTW, when I launched your database, I got a message that the AccessImagine OCX v1.74 cannot be found. Can this component be the source of your problem?
idefaz
6 years ago
hmm... interesting. So, the database wasn't 14mb for you? Also, that AccessImagine thing i never used... i totally forgot it was there. Maybe it is the issue. I shall see.
idefaz
6 years ago
No change. Maybe the form is broken. It doesn't happen if there is no iGrid on the form, though. I'm stumped.

click to open full size

UserPostedImage 
Igor/10Tec
6 years ago
Thank you for your video. It really helped to understand your problem.

I saved the form as a text file to understand which control has this big size. I issued the following command in the Immediate window:

Application.SaveAsText acForm, "Production", "D:\Stuff\Form_Production.txt"

Indeed, the internal OleData property for iGrid0 is extremely big. However, I have no ideas how to explain this except one - the form became corrupted at one point in time earlier, and now you get this "long tail" of binary data associated with the iGrid control.

I asked you to reproduce the problem in a new form and without uploading the background picture into iGrid. Have you tried that?
idefaz
6 years ago
I have not yet tried that. I will comment out that line in the code and put fresh iGrid objects to the current form i'm working on. If i experience the issue again i will let you know.

Thanks for looking into.
idefaz
6 years ago
So far i have not run into the issue while not loading the image to the bg. I think that may have been it.

I'll just not load the image while in dev mode.

Cheers, thanks for your time.
Igor/10Tec
6 years ago
Then, I think, the problem is in MS Access and how it processes images in 3rd-party ActiveX controls (in fact OLE data). The ability to set the grid background picture works in other development environments like Visual Basic 6 without any problems, so it seems the problem is on the side of MS Access.
idefaz
6 years ago
I just set the code to not load the image when in development mode. So far it's been working great. Thanks for the help!