473,898 Members | 2,952 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.Vi sible 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 1479
"Deano" <de***@mailinat or.comwrote in
news:5u******** *****@mid.indiv idual.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.Vi sible 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.Val ue = 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***@mailinat or.comwrote in message
news:5u******** *****@mid.indiv idual.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.Vi sible 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***@mailinat or.comwrote in
news:5u******** *****@mid.indiv idual.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
AbsolutePositio n 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.T xt"

Then I would try

LoadFromtext AcForm, "NewFormNam e", "FormName.T xt"

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.11 9...
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<gufffa w>

(Inside joke for Canadians)
>If I had this problem I would try:
SaveAsText AcForm, "FormName", "FormName.T xt"
Then I would try
LoadFromtext AcForm, "NewFormNam e", "FormName.T xt"
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*********@Se eSig.Invalidwro te 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
1723
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 : Form.Files.Save Any ideas how to fix or workaround for the Mac? Thanks.
11
3925
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 parsed can completely wreck it. The string I am trying to parse is as follows: commandText=insert into (Text) values (@message + N': ' + @category);commandType=StoredProcedure; message=@message; category=@category I am looking to retrive name value...
14
9756
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 the cause is fundamentally a networking problem is also making me pull my hair out. Some history: The network is composed of five computers dating back to 1995, each purchased one at a time, and each having a different OS, etc. Until
8
2887
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 stick so that I can work on it anywhere without having to keep updating it on various machines. The disk has never had any other errors, all other files are fine, it has plenty of space and checkdisk reports no errors. The database is split...
0
9993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11254
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10946
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10480
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9658
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5876
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3303
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.