Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

A2002 (sub)form behaviour driving me crazy!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vladimír Cvajniga - 05 Mar 2007 12:02 GMT
Hi,

in A2002 i have a form with a subform that I need to initialize on Form_Open
(I set subform controls' position & visibility & finally subform's width).
In some cases (when I interrupt the code and go to form designer) the
subform saves it's last appearance (and all controls' properties!!!)
according to the initialization procedure. Then I open the form in preview
and all the dynamic stuff is gone since subform's controls' properties are
set incorrectly - they were saved when I interrupted the code and went to
form designer.

I mean I need subform's controls in the same initialiation status always
when I open main form and I'd like to get all controls back in their init
status when I go to design mode. Setting forrm's and subform's property
AllowDesignChanges to FALSE doesn't help. Is there any workaround? Or do I
have to save all my forms in separate MDB so that I have their original
initialization status if this happens?

Sorry for my poor English... I hope you got the idea.

TIA

Vlado
Stefan Hoffmann - 05 Mar 2007 12:21 GMT
hi,

> In some cases (when I interrupt the code and go to
> form designer) the subform saves it's last appearance (and all controls'
> properties!!!) according to the initialization procedure.
Don't save changes while debugging.

mfg
--> stefan <--
Vladimír Cvajniga - 05 Mar 2007 12:35 GMT
TYVM for your respond, stefan.

What about changes in code modules? And sometimes I may forget that I'm in
debug mode... should I make no changes in debug at all?

> hi,
>
[quoted text clipped - 5 lines]
> mfg
> --> stefan <--
Allen Browne - 05 Mar 2007 13:11 GMT
Stefan is correct: saving in Break mode significantly increases the chance
of corrupting your database.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> TYVM for your respond, stefan.
>
[quoted text clipped - 10 lines]
>> mfg
>> --> stefan <--
Vladimír Cvajniga - 05 Mar 2007 13:36 GMT
Pitty... since I'd expect I would be able to make changes in code (in break
mode) and thus easily repair mistakes. If I may not make any changes in
break mode then I always have to:

1) stop the execution
2) close all open objects
3) go to the code and repair one or two lines
4) save
5) run the project again to check out if it's OK; if not, go to 1)

Why MS has built a program like this? Can't believe it's true... If there
was a possibility to choose from
a) Save project to MDB
b) Save project to text files

I would always set Access to b).

Vlado

> Stefan is correct: saving in Break mode significantly increases the chance
> of corrupting your database.
[quoted text clipped - 13 lines]
>>> mfg
>>> --> stefan <--
Vladimír Cvajniga - 05 Mar 2007 13:44 GMT
Hmm... and if I stop the execution in break mode and make some changes, will
there be no risk of database corruption?
I'd like to know how MS Access handles program modules... in detail.

Vlado

> Pitty... since I'd expect I would be able to make changes in code (in
> break mode) and thus easily repair mistakes. If I may not make any changes
[quoted text clipped - 32 lines]
>>>> mfg
>>>> --> stefan <--
Allen Browne - 05 Mar 2007 23:50 GMT
No. You don't have to make all those steps. Just don't change the code while
it is running (i.e. without stopping the code first.)

Access keeps 2 copies of the code:
- the binary version of the form's code (pseudo-compiled);
- the text version (the one you view and edit.)

When you start modifying a form, Access creates a copy (so you can revert if
you don't wish to save.) It is now juggling 4 copies of the code.

If you start editing while the code is in break mode, Access is supposed to
create these copies while the code is executing in break mode, and still
resume the code.

Occassionally it drops the ball in the middle of this juggling act, and the
result is a corrupt form. A decompile will sometimes rescue the form, but
you can avoid the corruption by stopping to the code and switching to design
view before you edit the code.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hmm... and if I stop the execution in break mode and make some changes,
> will there be no risk of database corruption?
[quoted text clipped - 38 lines]
>>>>> mfg
>>>>> --> stefan <--
Vladimír Cvajniga - 06 Mar 2007 07:59 GMT
This is what all Access developers should know before they start their first
application. TYVM for detailed info, Allen. I've ordered Access 2002
Developer's Handbook but I'm affraid I won't find any Access background
secrets in that book.

I hope that MS will do some research on Access MDB corruption and will
change a few things to make Access safer. In a mean time they could publish
a list of the most dangerous things in Access and some help how to avoid all
potentional problems.

I was lookin forward to A2007 (CZ trial version should be available soon)
but I'm not sure if I really need Access that may destroy my projects. I
tend to switch to Delphi but first I'd like to test some things to see if
it's the right decision.

Thank you very much for your time, Allen. I really appreciate your work
here.

Vlado

> No. You don't have to make all those steps. Just don't change the code
> while it is running (i.e. without stopping the code first.)
[quoted text clipped - 57 lines]
>>>>>> mfg
>>>>>> --> stefan <--
Vladimír Cvajniga - 10 Mar 2007 02:05 GMT
Does this problem correspond with AllowDesignChanges property? I always set
it to False (Design View Only). So that I expect that all controls'
properties will be reset to their original design-view-values when I'm back
in design view.

Is that a bug in A2002?

> Hi,
>
[quoted text clipped - 19 lines]
>
> Vlado
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.