Weird little changes in Access 2007

evanscamman

Registered User.
Local time
Yesterday, 23:04
Joined
Feb 25, 2007
Messages
274
I am finishing up a Access 2003 database in 2007 - retaining the .MDB format. I've noticed a few odd things, but have been unable to find any documentation addressing them. I'd like to know if anybody else has noticed the same things, or if I'm just weird or my computer is evil.

1) It seems that the way global variables work has changed. In 2003 I had a global variable that passed data to the query for my subform. This worked fine. But in Access 2007 before the form loads, the query asks for the value of the global variable. I was forced to use a hidden field instead to supply data to the query.

2) Similar problem with global variables used to create an instance of Outlook:

Code:
Public golApp As Outlook.Application
Public golNameSpace As Outlook.NameSpace

This worked find in 2003, but now in 2007 they don't retain their value. Once the code has executed and the user then clicks anywher on the form they lose their value and cause 'Connection to the remote server was lost' errors.
I worked around this by redeclaring the variables before use, which makes me wonder - where are the original instances going, since I didn't close them?

3) I created a new checkbox and it didn't have an 'AfterUpdate' event, but existing checkboxes on the same form (created in 2003) do. It seems that the new checkboxes are a bit emasculated - having only half of the events and far fewer fields in the Property window.

I've read everything I can find detailing the changes to 2007 but haven't seen anything that addresses these issues. Please help.

Thank you,
Evan
 
1. I'd have to look at your entire code to tell what is going on with the variables.

2. As for the After Update event for the checkboxes, I would like to see a screenshot of exactly what you're seeing. I've not seen a problem like that before.
 
Here's the screenshot - it made me scale it way down...
New check box property window shown on left - missing lots of fields.

picture.php
 
What do you see if you look at the EVENTS tab instead of the ALL tab?
 
Same thing:

BeforeUpdate, AfterUpdate, OnDblClick, OnEnter, OnExit are missing.
 
So what Service Pack are you on?

Also, just to note, you should be able to get to the events from the VBA window anyway, but I'm wondering if there is something that needs to be reported to the Access team. We'll want to see if we can recreate it.
 
I'm using SP2 MSO (12.0.6529.5000) - I think it's the latest.

------------------

I think I figured out what is going on:
It's not about 2003 or 2007. It's about whether the check box was created inside an Option Group.

I can get this to happen every time by doing the following:

1) Create new database
2) Add an option group to a blank form
3) Add 1 check box inside the option group and 1 outside.

The check box inside the option group is missing 5 events.
If you try to used the missing event in VBA you will crash Access.

To work around this, drag the check box not created inside the Option group into the option group and it seems to function normally.
 
Well, that would explain it. When you use an option group it is the OPTION GROUP's After Update, Before Update, etc. event that you use and not the individual control's anyway.
 
I see. My option group didn't even have any options - I was just using it for the frame (I liked the nice rounded edges on the box better than the Rectangle object.) Perhaps I'm asking for trouble.

So, thanks for the help!



With the other issue, there's hardly any code to post:

In the parent form's global definitions:
Code:
Public blnIsLoading as Boolean

And in the query that is record source for the subform:
... iif([Forms]![myForm].[blnIsLoading],True,False) .......

This used to work, but now it seems that the query launches before the variable has been declared.
 
If you want a global variable you want to really put it in a standard module and not in a form module.

By the way, I'm not sure why it would work in 2003 and not in 2007 but are you aware that subforms load first and then the main form?
 
Thanks for the tip about putting global variables in standard modules. I'll keep that in mind.

Yes, I was aware that subforms load first. But since they worked fine before the upgrade I figured there must have been some other small change to the order in which a form loads up.

Problem solved though - or at least worked around.
As always, Bob, you have been very helpful. Thank you!

Evan
 

Users who are viewing this thread

Back
Top Bottom