I have a form that has a data source ‘APTS’ and I am trying to store a field value directly into a Public global variable ‘sale.Picture’ and then transfer it into a second form controlled by a different table. When I do this with text fields with text boxes it works fine using code like:
saleOwnerName = Me.[OwnerName] from form1
Me.[OwnerName2] = saleOwnerName into a second form2
Where ‘saleOwnerName’ is a public variable declared as a variant. And this works fine, copying the text data to the new table.
However, if I do the same with a field in the table holding a picture (bmp) (OLE Object) where the Public variable is ‘sale.Picture’ as a variant, it does not work. I get no errors but it does not copy into the new table.
If I change the ‘salePicture’ Public variable type from ‘Variant’ to ‘Object’ I get the error: ‘Object variable or With Block variable not set’
How do you declare a public variable so that it will copy an OLE Object so it will copy correctly to the new table or do I need a different approach. I still want to use the Public Variable.
Thanks
saleOwnerName = Me.[OwnerName] from form1
Me.[OwnerName2] = saleOwnerName into a second form2
Where ‘saleOwnerName’ is a public variable declared as a variant. And this works fine, copying the text data to the new table.
However, if I do the same with a field in the table holding a picture (bmp) (OLE Object) where the Public variable is ‘sale.Picture’ as a variant, it does not work. I get no errors but it does not copy into the new table.
If I change the ‘salePicture’ Public variable type from ‘Variant’ to ‘Object’ I get the error: ‘Object variable or With Block variable not set’
How do you declare a public variable so that it will copy an OLE Object so it will copy correctly to the new table or do I need a different approach. I still want to use the Public Variable.
Thanks