473,508 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A2003 Subform Dataentry = False Causes Crash

Given a bound continuous subform in an unbound main form, a button on
the subform sets allowadditions = true and dataentry = true. This works
no problem.

But a second button on the subform which is meant to switch the the
above off crashes whenever me.dataentry = false is executed. The full
code for the button is:

Private Sub btnOK_Click()

Me.AllowAdditions = False

Me.DataEntry = False 'always crashes at this step

Me.AllowEdits = False

sAddEditEnable False 'a simple proc which enables, disables various
buttons

End Sub

Whether or not the offending line is first or not, Access dies.

Any ideas, suggestions? TIA.
--
Tim
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #1
1 2125
The main form is unbound, but is there anything in the
LinkMasterFields/LinkChildFields properties of the subform control?

If so, make sure there is a text box in the subform for the field(s)
specified in LinkChildFields. There is a bug in Access 2002 and 2003 that
causes it to crash if LinkChildFields referst to an AccessField type object,
and you can work around it by placing a text box on the subform so it refers
to a Control type object instead.

If that's not the issue, this is probably a corruption. First up, uncheck
the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://members.iinet.net.au/~allenbrowne/bug-03.html
Then compact to get completely rid of this stuff:
Tools | Database Utilities | Compact.

Next, decompile a copy of the database by entering something like this at
the command prompt while Access is not running. It is all one line, and
include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

At this point, you should have a working database. If not, rebuild the
database by following the 6 steps for the first symptom in:
Recovering from Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-47.html

Let's know at which point you got this solved. I would definately follow
through the decompile and compact anyway.

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

"Tim Marshall" <TI****@antarctic.flowerpots> wrote in message
news:cn**********@coranto.ucs.mun.ca...
Given a bound continuous subform in an unbound main form, a button on the
subform sets allowadditions = true and dataentry = true. This works no
problem.

But a second button on the subform which is meant to switch the the above
off crashes whenever me.dataentry = false is executed. The full code for
the button is:

Private Sub btnOK_Click()

Me.AllowAdditions = False

Me.DataEntry = False 'always crashes at this step

Me.AllowEdits = False

sAddEditEnable False 'a simple proc which enables, disables various
buttons

End Sub

Whether or not the offending line is first or not, Access dies.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1925
by: Debster | last post by:
I am having a hard time trying to figure out why my code is not working properly. I step through the code and check the values when adding the data to the table, but my Refresh or Requery is not...
1
3251
by: Momo4 | last post by:
I have a unbound main form with unbound fields that correspond to fields on a bound data sheet subform. As you enter data on the subform, the corresponding fields get updated through code (e.g....
1
2574
by: jcazmail-groups | last post by:
The following snippet gives me an error on the line regarding AllowAdditions = False: Private Sub EditLocked() txtDeliveryDate.Locked = True cmdDeliveryDate.Enabled = False...
6
5589
by: Bob Quintal | last post by:
Using Access '97. I have a subform, where the .AllowAdditions property is set to false. I have a button labelled 'Add record' that sets this property = true, followed by a DoCmd.gotoRecord...
6
5938
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
4
2792
by: Ecohouse | last post by:
have a main form with two tabs, and each tab has a subform. The first tab's subform refers to the mainform (this works). The second tab's subform refers to the identity key of the first tab's...
2
2060
kcdoell
by: kcdoell | last post by:
Hello: I have four tables: tblDivision tblWorking_Region tblCredit_Region tblForecast (This is the main data entry table for all forecasting records) tblDivision has the following fields:
1
1515
by: Fred Zuckerman | last post by:
I have a database on a shared drive. It has user level security (ie: mdw file). It was created in A2000 and works fine when opened on workstations with A2000 installed. Some workstations have...
3
1725
by: Zippy | last post by:
I have recently moved from A97 to A2003. I find it inconvenient that I can no longer double-click on the subform to open it in full view. I had a hunt around the newgroups and couldn't find...
0
7225
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
7124
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
7326
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
7385
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
7046
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...
0
5629
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
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
418
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...

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.