By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,544 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

A2K - form "corrupts", any ideas why?

P: n/a
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

Jan 4 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Deano" <de***@mailinator.comwrote in
news:5u*************@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

Jan 4 '08 #2

P: n/a
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" <de***@mailinator.comwrote in message
news:5u*************@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?
Jan 4 '08 #3

P: n/a
"Deano" <de***@mailinator.comwrote in
news:5u*************@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_...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!”
Jan 4 '08 #4

P: n/a

"lyle fairfield" <ly******@yah00.cawrote in message
news:Xn************************@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.
Jan 4 '08 #5

P: n/a
lyle fairfield <ly******@yah00.cawrote:
>The first thing that comes to my mind is:
”Have you used any Control or Property named ‘Mulroney’?”
<snort <chuckle<gufffaw>

(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/
Jan 6 '08 #6

P: n/a

"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:47***********************@per-qv1-newsreader-01.iinet.net.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.
Jan 6 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.