dbTalk Databases Forums  

A2K - form "corrupts", any ideas why?

comp.databases.ms-access comp.databases.ms-access


Discuss A2K - form "corrupts", any ideas why? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bob Quintal
 
Posts: n/a

Default Re: A2K - form "corrupts", any ideas why? - 01-03-2008 , 07:58 PM






"Deano" <deano (AT) mailinator (DOT) com> wrote in
news:5u5h1tF1gcc1kU1 (AT) mid (DOT) individual.net:

Quote:
Every once in a while I modify one particular form (could be
anything from adding code to tweaking properties as far as I can
see) and upon loading I get;

"You can't assign a value to this object"

The form is now completely blank and I can only see anything if I
switch to design view. I am kaking changes that will break the
form admittedly but those are bugs of course and I expect to be
able to fix them.

It is always related to a couple of controls, a combo box and a
checkbox. Usually I have found the only way to proceed is to
restore a backup of the form. Today I tried replacing the combo
but though this worked, the code referencing the checkbox stopped
working. Replacing that checkbox anew didn't help.

This is the code in the load event;

If cboSuperRate.Visible Then
chkSuper.Value = True
End If

It's quite annoying that after making lots of changes to redesign
the form I basically have to start again. The form is still
available in design view so I can copy what I did including any
new code but I'm mystified as to what's going on. Apart from
increasing my backup frequency can anyone suggest what I might do
to stop this happening?


thanks

Could it be that you forgot to qualify the checkbox?
you wrote chkSuper.Value = True
Me!chkSuper.Value = True often works much better.




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com



Reply With Quote
  #2  
Old   
Deano
 
Posts: n/a

Default A2K - form "corrupts", any ideas why? - 01-03-2008 , 08:39 PM






Every once in a while I modify one particular form (could be anything from
adding code to tweaking properties as far as I can see) and upon loading I
get;

"You can't assign a value to this object"

The form is now completely blank and I can only see anything if I switch to
design view. I am kaking changes that will break the form admittedly but
those are bugs of course and I expect to be able to fix them.

It is always related to a couple of controls, a combo box and a checkbox.
Usually I have found the only way to proceed is to restore a backup of the
form. Today I tried replacing the combo but though this worked, the code
referencing the checkbox stopped working. Replacing that checkbox anew
didn't help.

This is the code in the load event;

If cboSuperRate.Visible Then
chkSuper.Value = True
End If

It's quite annoying that after making lots of changes to redesign the form I
basically have to start again. The form is still available in design view
so I can copy what I did including any new code but I'm mystified as to
what's going on. Apart from increasing my backup frequency can anyone
suggest what I might do to stop this happening?


thanks




Reply With Quote
  #3  
Old   
Allen Browne
 
Posts: n/a

Default Re: A2K - form "corrupts", any ideas why? - 01-03-2008 , 08:46 PM



Deano, first thing we need to do is to confirm whether the form is
corrupting, or whether this is merely a bug in Access.

Lets assume:
a) The form is set up so that you can't add records. This could be due to
AllowAdditions being set to No, or it could be because the form is bound to
a non-updatable query.

b) You filter the form so it returns now records.

In this case, the Detail section of the form goes completely blank, since
there is nothing to show (not even the new record.) Now, attempting to refer
to the value of a control can result in nonsensical error messages. Here's
more information about this:
Incorrect display of data
at:
http://allenbrowne.com/bug-06.html

If that's not the issue, here's some guidelines on how to avoid corruption:
http://allenbrowne.com/ser-25.html

--
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.

"Deano" <deano (AT) mailinator (DOT) com> wrote

Quote:
Every once in a while I modify one particular form (could be anything from
adding code to tweaking properties as far as I can see) and upon loading I
get;

"You can't assign a value to this object"

The form is now completely blank and I can only see anything if I switch
to
design view. I am kaking changes that will break the form admittedly but
those are bugs of course and I expect to be able to fix them.

It is always related to a couple of controls, a combo box and a checkbox.
Usually I have found the only way to proceed is to restore a backup of the
form. Today I tried replacing the combo but though this worked, the code
referencing the checkbox stopped working. Replacing that checkbox anew
didn't help.

This is the code in the load event;

If cboSuperRate.Visible Then
chkSuper.Value = True
End If

It's quite annoying that after making lots of changes to redesign the form
I
basically have to start again. The form is still available in design view
so I can copy what I did including any new code but I'm mystified as to
what's going on. Apart from increasing my backup frequency can anyone
suggest what I might do to stop this happening?


Reply With Quote
  #4  
Old   
lyle fairfield
 
Posts: n/a

Default Re: A2K - form "corrupts", any ideas why? - 01-03-2008 , 11:06 PM



"Deano" <deano (AT) mailinator (DOT) com> wrote in
news:5u5h1tF1gcc1kU1 (AT) mid (DOT) individual.net:

Quote:
It's quite annoying that after making lots of changes to redesign the
form I basically have to start again. The form is still available in
design view so I can copy what I did including any new code but I'm
mystified as to what's going on. Apart from increasing my backup
frequency can anyone suggest what I might do to stop this happening?
I think if you allow the controls on the form to vote about any changes,
that should help. (Power corrupts). And although the ABS function and the
AbsolutePosition Property are Powerful be careful not to use them because
Absolute Power Corrupts Absolutely.

The first thing that comes to my mind is:
”Have you used any Control or Property named ‘Mulroney’?”

If I had this problem I would try:

SaveAsText AcForm, "FormName", "FormName.Txt"

Then I would try

LoadFromtext AcForm, "NewFormName", "FormName.Txt"

Often, Access will identify anything that would cause corruption in that
LoadFromText procedure, and may give you that information.

And if it doesn't, you have a text manifestation of your form that you
can post here; someone may examine it and notice something likely.

Of course, the corruption may be in something the form references. In
that case, saving the whole db as text and rebuilding it may help. Code
for doing so can be found many places: one is
http://www.ffdba.com/downloads/Save_...ts_As_Text.htm

I know you are a fairly regular poster here and much too accomplished to
run anything I have suggested on your one and only sacred copy of a
database that took two years of toil to develop, but for beginners who
might read this I’ll say, “Use a throw-away copy when fooling with
anyone’s code, especially mine!”


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.