Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2004, 05:21 AM
Authorized User
 
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default No active form during OnLoad

I've designed a data entry system that uses a public function that uses screen.activeform to resize each main form and its subform and to reposition controls to accomodate differing numbers of records in the subform. This works fine.

I've designed similar forms with subforms to review the data and these are unable to use the public resize function during loading because there is no active form at the time the function is called.

Using debug to step through the loading sequences I find that with the data entry forms, a blank window displays immediately the OnLoad procedure starts and is gradually populated during the procedure, hence there is always an active form. The data review forms don't display until the OnLoad procedure completes, hence I can't refer to the active form.

As far as I can see, the two sets of forms are basically the same in the way they obtain and display data. What is it that allows one set to display immediately and the other to remain invisible until all OnLoad procedures are complete?
 
Old May 23rd, 2004, 06:25 PM
Authorized User
 
Join Date: Oct 2003
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Bob,
Being not that experienced in VBA, I'm unfamiliar with the anomoly you're experiencing.
Not to assume you haven't thought of this already, but as an alternative, could you apply your public function to a different event on the form?
eg; OnActivate, OnCurrent, OnEnter....
Just a thought, good luck either way!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Methods of an Active form Prakash001 General .NET 2 October 23rd, 2007 08:53 AM
Print active form with listview pavel Pro VB 6 4 November 22nd, 2004 02:10 PM
How to print an active form pavel Pro VB 6 1 April 22nd, 2004 08:29 AM
audio onLoad Larson HTML Code Clinic 2 February 21st, 2004 12:39 AM
How to set an active form to Nothing. MisbahAnsari VB.NET 1 October 21st, 2003 02:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.