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 December 15th, 2004, 10:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default Unexpected Form Behavior

I have a bound form that first opens in “view mode” (i.e. AllowAdditions, AllowEdits, and AllowDeletions are all FALSE). This works fine when the underlying table has data in it; but when it doesn’t (i.e. no records for the primary key), the form opens up with no controls visible at all in the detail section. The detail section is totally blank. I would like for the form to open with the controls visible even though there are no data and all the fields would be blank.

Are there any other options besides opening the form in “edit mode” and just locking all the fields (which needs code to loop through all the controls to set their Locked properties to False vs. one simple command like Me.AllowEdits = False)?
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
 
Old December 16th, 2004, 05:14 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think what you are suggesting is the way to go:

Dim C as Control

For each C in Me.Controls
    C.Locked = True
    C.Enabled = False
Next C

I think that would work - the user could not change anything, but would not get an empty form.

 
Old December 16th, 2004, 05:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Another suggestion is to set AllowAdditions to TRUE but not let the user navigate to a new record. It's the AllowAdditions to FALSE that's causing the problem. :(





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected error ramkris84 ASP.NET 1.0 and 1.1 Professional 2 April 19th, 2008 04:48 AM
do not understand asp web form behavior dhx10000 Classic ASP Professional 9 December 13th, 2006 06:34 PM
Unexpected enter parameter value lic023 Access VBA 1 March 13th, 2006 03:49 PM
Unexpected T_VARIABLE deamato BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 26th, 2005 08:11 PM
unexpected behavior from microsoft web page ronaldo11 C# 0 July 6th, 2003 09:33 AM





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