473,761 Members | 10,057 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.AllowAdditio ns = 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 2139
The main form is unbound, but is there anything in the
LinkMasterField s/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\m saccess.exe" /decompile
"c:\MyPath\MyDa tabase.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****@antarct ic.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.AllowAdditio ns = 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
1935
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 displaying on the subform. Any suggestions? Thanks for your help!!!!!!!!!! ********************** Code ************************************* Private Sub cmdOK_Click() On Error GoTo Err_Handler
1
3283
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. Me. = Forms!!) All of the new records on the subform are related through the "RunNumber" on the main form. The main form also subtotals the weights on the subform to allow the user to double check totals against paperwork. When the user wants to...
1
2591
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 cboidCustomers.Locked = True frmOrdersDesignSubForm.Locked = True ' the following line produces the error
6
5606
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 acNewRecord. a Save button sets me.dirty = false; me.AllowAdditions = False a Cancel button sets me.undo; me.AllowAdditions = False This works correctly.
6
5975
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 forms in the database that will use this function, so I need to be able to tell the code which form to unlock. What I have is as follows: Public Function akeyEdit()
4
2804
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 subform. I can't get the second subform to show the proper records. I have used the child and masterlink fields. I have set the recordsource of the second subform to include the identity key field on the first subform. This an accounting...
2
2089
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
1528
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 A2003 installed. On those workstations there is an unbound form that continually gives the un-useful message: "Microsoft Access Has Encountered A Problem And Must Shutdown, We're Sorry For The Inconvenience"
3
1735
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 anything helpful. I know that I can right-click to open, but is there anything I can do to make it do it the 'good old way'? -- Zippy S
0
9521
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
9333
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
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...
0
9945
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9900
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,...
1
7324
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5214
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...
1
3863
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
2733
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.