473,513 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A2K - form "corrupts", any ideas why?

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
6 1456
"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
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
"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

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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1708
by: Simon Wigzell | last post by:
I'm using a third party piece of code to upload files from a customer. It works fine on a PC. On a mac however, the files end up corrupted. The code that does the actual file save is this : ...
11
3864
by: Martin Robins | last post by:
I am trying to parse a string that is similar in form to an OLEDB connection string using regular expressions; in principle it is working, but certain character combinations in the string being...
14
9718
by: David W. Fenton | last post by:
I'm no stranger to this error message, but I have a client who is experiencing it, but, fortunately, without any actual data corruption, and it's driving them made. Their inability to grasp that...
8
2873
by: Andrew | last post by:
I am currently designing a database, using Access 2003 running on Windows Vista Premium Home. The database file format is Access 2002 / 2003 (mdb). The database is stored on a 1Gb USB memory...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.