Re: A2K - form "corrupts", any ideas why?

Re: A2K - form "corrupts", any ideas why?

am 04.01.2008 01:58:27 von Bob Quintal

"Deano" wrote in
news:5u5h1tF1gcc1kU1@mid.individual.net:

> 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

A2K - form "corrupts", any ideas why?

am 04.01.2008 02:39:16 von Deano

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

Re: A2K - form "corrupts", any ideas why?

am 04.01.2008 02:46:51 von Allen Browne

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" wrote in message
news:5u5h1tF1gcc1kU1@mid.individual.net...
> 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?

Re: A2K - form "corrupts", any ideas why?

am 04.01.2008 05:06:43 von Lyle Fairfield

"Deano" wrote in
news:5u5h1tF1gcc1kU1@mid.individual.net:

> 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_MDB_Objects_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!”

Re: A2K - form "corrupts", any ideas why?

am 04.01.2008 15:20:04 von Deano

"lyle fairfield" wrote in message
news:Xns9A1AEB1C1C1B06666646261@216.221.81.119...

> 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!"

Indeed! I have come so close to losing EVERYTHING it makes me shudder, I'm
a backup freak now.

Thanks for the suggestions guys, I will try them tonight after a calming
visit to the Natural History Museum here in London town. Seriously after
too much Access I know I need to stop myself going mad and taking a break is
sometimes a good solution to a problem.

Re: A2K - form "corrupts", any ideas why?

am 06.01.2008 02:20:50 von Tony Toews

lyle fairfield wrote:

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



(Inside joke for Canadians)

>If I had this problem I would try:
>SaveAsText AcForm, "FormName", "FormName.Txt"
>Then I would try
>LoadFromtext AcForm, "NewFormName", "FormName.Txt"

That's what I was gong to suggest.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

Re: A2K - form "corrupts", any ideas why?

am 06.01.2008 03:35:27 von Deano

"Allen Browne" wrote in message
news:477d900f$0$25497$5a62ac22@per-qv1-newsreader-01.iinet.n et.au...
> 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.
>

AllowAddtions, remarkably was the problem. Which is rather odd as it never
solved the problem before. I'll file the possible solutions for a future
occurrence.