Re: Having Problem With Access Developers Handbook Form Scaling Tool

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 14:00:14 -0600

A good thing to know, thanks for posting your solution.

-- 
Marsh
MVP [MS Access]
Wayne Pearson wrote:
>I've since discovered that calling frmImage's Refresh method in Form_Load
>enables me to avoid the problems I referred to in my previous post.
>Additionally, frmImage now gets the focus when it is initially displayed.
>I'm not sure why this solution succeeds or if there are any caveats to
>using it but it works for me.
>
>"Wayne Pearson"  wrote:
>> I've been trying out the excellent form resizing/scaling tool from the
>> Access Developer's Handbook. However, I've encountered a problem.
>>
>> Note that I'm using Access 2000, Office 2000, and Windows 2000; each of
>> which has the latest service packs applied.
>>
>> I have a table, tblImage, with two fields
>>
>>     ImageID - Autonumber
>>     Image     - OLE Object
>>
>>     The table has three small bitmap images in it.
>>
>>
>> I have a query, qryImage
>>
>>     SELECT tblImage.Image FROM tblImage;
>>
>>
>> And I have a form, frmImage
>>
>>     frmImage's record source is set to qryImage and its Allow Additions,
>>     Allow Deletions, and Allow Edits properties are all set to False. I wish to use
>>     the form only for viewing the images.
>>
>>     frmImage has an OLEBound control with its Control Source set to Image and its
>>     Size Mode set to Zoom.
>>
>>     frmImage has one member variable m_frmResize and the Form_Open and
>>     Form_Close event procedures that enable using the form resizing/scaling tool.
>>
>>
>> I encounter a problem when I display frmImage; it doesn't receive the focus until
>> after I click on it and then when I attempt to browse the images I get an error stating
>> "Microsoft Access can't save your changes to this bound OLE object".
>>
>> Note that if I set frmImage's Allow Edits property to True then everything
>> works Ok with the exception that the form does not initially get the focus.
>>
>>
>> The code for frmImage is fairly short, just two event procedures -
>> Form_Open and Form_Close,  so I include it below.
>>
>>
>> '-------------------------- Start of frmImage code --------------------------
>> Option Compare Database
>> Option Explicit
>>
>> Dim m_frmResize As ADHResize2K.FormResize
>>
>> Private Sub Form_Open(Cancel As Integer)
>>     On Error GoTo HandleErrors
>>
>>     Set m_frmResize = ADHResize2K.CreateFormResize()
>>     Set m_frmResize.Form = Me
>>     Call m_frmResize.SetDesignCoords(1024, 740, 96, 96)
>>
>> ExitProcedure:
>>     On Error GoTo 0
>>     Exit Sub
>>
>> HandleErrors:
>>     MsgBox Err.Description
>>     Resume ExitProcedure
>> End Sub
>>
>> Private Sub Form_Close()
>>     On Error GoTo HandleErrors
>>
>>     Set m_frmResize = Nothing
>>
>> ExitProcedure:
>>     On Error GoTo 0
>>     Exit Sub
>>
>> HandleErrors:
>>     MsgBox Err.Description
>>     Resume ExitProcedure
>> End Sub
>> '--------------------------- End of frmImage code --------------------------


Relevant Pages

  • Re: Having Problem With Access Developers Handbook Form Scaling Tool
    ... frmImage now gets the focus when it is initially displayed. ... > The table has three small bitmap images in it. ... > Private Sub Form_Open ... > On Error GoTo HandleErrors ...
    (microsoft.public.access.formscoding)
  • Re: Errro Handling
    ... Dim MyArray() As String ... > Error Handler so that it would process as I expected on subsequent loops. ... > Helmut Weber then suggested that I change Err.Clear to On Error Goto -1. ... > Sub Test ...
    (microsoft.public.word.vba.general)
  • Re: New Record
    ... Private Sub Not_In_List(strNewData As String, ... On Error GoTo Err_Handler ... exception of the New Name that is in the "Supplier Name" Field. ... should be displaying the New Supplier Number (in the ...
    (microsoft.public.access.gettingstarted)
  • Re: Errro Handling
    ... purposely generate an error with Each loop and trying understand the use of ... Helmut Weber then suggested that I change Err.Clear to On Error Goto -1. ... Sub Test ... Dim oPara As Word.Paragraph ...
    (microsoft.public.word.vba.general)
  • Re: search plain text files including wildcards
    ... If I'd use the FindStr command. ... Private Declare Sub Sleep Lib "kernel32" ... On Error GoTo Sleeper ... Character class: ...
    (microsoft.public.vb.general.discussion)