I'm trying to add a new form and report to an existing Access 2013 database I'm using to manage a photocard collection. I'm running into a problem with the VBA code necessary to create thumbnails for the form and report I'm trying to create. Here is the single line of code I'm trying to implement to generate a thumbnail, On Exit event.
Private Sub Picture7_Exit(Cancel As Integer)
If Picture7.Changed Then Preview.Value = Picture7.PreviewOLE(64) 'Creates thumbnail photo upon exiting the form
End Sub
Picture7 identifies the object from my product table for the OLE Photo.
Preview identifies the object from my product table for the Binary Object created for the thumbnail.
Here is my problem. The VBA on exit event module recognizes Picture7 as an existing object (Intellisense list and turns blue it as soon as I type the period after Picture7) but does NOT recognize Preview in the same way. Not surprisingly, I get the following error, Run-Time error '424': object required, when the code attempts to execute.
Both are existing objects/fields in my products table.
I know it works because I've created several new small test databases using the same product table and field names and when I create the module with the code above, intellisense recognizes both objects (Picture7 & Preview) without fail and it executes perfectly.
So, my question is why is my existing DB, not discovering/recognizing/finding the Preview object. What do I have to do so it will?
Hopefully, I've given enough detail to understand my problem. If I haven't, please ask for details to clarify the issue. This problem is driving me crazy. Thanks.
Bill