Re: Having Problem With Access Developers Handbook Form Scaling Tool
From: Marshall Barton (marshbarton_at_wowway.com)
Date: 03/25/04
- Next message: Marshall Barton: "Re: How to make it Null"
- Previous message: NormaD: "Filling a text box with an Name instead of ID No."
- In reply to: Wayne Pearson: "Re: Having Problem With Access Developers Handbook Form Scaling Tool"
- Messages sorted by: [ date ] [ thread ]
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 --------------------------
- Next message: Marshall Barton: "Re: How to make it Null"
- Previous message: NormaD: "Filling a text box with an Name instead of ID No."
- In reply to: Wayne Pearson: "Re: Having Problem With Access Developers Handbook Form Scaling Tool"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|