473,666 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subform and .dataentry property issue

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.gotoRecor d acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditio ns = False
a Cancel button sets me.undo; me.AllowAdditio ns = False

This works correctly.

I'd like to set me.DataEntry = True instead of goto the new record,
and that works fine, but when I set me.DataEntry false during the
Save or Cancel, the subform insists on showing all records in the
control source for the subform. Setting me.filterOn hides the
records except for the Main record. I tried resetting the Link
child fields property, but that can supposedly be done at Form_Open

Any workarounds, advice?

--
Bob Quintal

PA is y I've altered my email address.
Jan 11 '06 #1
6 5599
Bob,
Try (re)setting the sourceobject for the sub
Something like
Me!SubForm.Sour ceObject = "YourSourceObje ct"
Me!SubForm.Link ChildFields = "WhateverID "
Me!SubForm.Link MasterFields = "WhateverID "

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympa tico.ca> schreef in bericht news:Xn******** **************@ 207.35.177.135. ..
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.gotoRecor d acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditio ns = False
a Cancel button sets me.undo; me.AllowAdditio ns = False

This works correctly.

I'd like to set me.DataEntry = True instead of goto the new record,
and that works fine, but when I set me.DataEntry false during the
Save or Cancel, the subform insists on showing all records in the
control source for the subform. Setting me.filterOn hides the
records except for the Main record. I tried resetting the Link
child fields property, but that can supposedly be done at Form_Open

Any workarounds, advice?

--
Bob Quintal

PA is y I've altered my email address.

Jan 11 '06 #2
I concur with Arno.

There is definitely a problem in which changing some properties of a
subform can cause it to loose its link to the parent form record, and
reassigning the subform's recordsource property does seem to fix the
problem when this occurs.

Arno R wrote:
Bob,
Try (re)setting the sourceobject for the sub
Something like
Me!SubForm.Sour ceObject = "YourSourceObje ct"
Me!SubForm.Link ChildFields = "WhateverID "
Me!SubForm.Link MasterFields = "WhateverID "

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympa tico.ca> schreef in bericht news:Xn******** **************@ 207.35.177.135. ..
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.gotoRecor d acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditio ns = False
a Cancel button sets me.undo; me.AllowAdditio ns = False

This works correctly.

I'd like to set me.DataEntry = True instead of goto the new record,
and that works fine, but when I set me.DataEntry false during the
Save or Cancel, the subform insists on showing all records in the
control source for the subform. Setting me.filterOn hides the
records except for the Main record. I tried resetting the Link
child fields property, but that can supposedly be done at Form_Open

Any workarounds, advice?

--
Bob Quintal

PA is y I've altered my email address.

Jan 11 '06 #3
Steve Jorgensen <no****@nospam. nospam> wrote in
news:5M******** *************** *******@comcast .com:
I concur with Arno.
Thank you Steve and Arno. I'll try resetting the sourceObject.

I know that when I tried to reset the link_____Fields
properties, Access complained that they could only be changed in
design mode or in the parent's Form_Open Event..

I didn't think of changing the source object first.


There is definitely a problem in which changing some
properties of a subform can cause it to loose its link to the
parent form record, and reassigning the subform's recordsource
property does seem to fix the problem when this occurs.

Arno R wrote:
Bob,
Try (re)setting the sourceobject for the sub
Something like
Me!SubForm.Sour ceObject = "YourSourceObje ct"
Me!SubForm.Link ChildFields = "WhateverID "
Me!SubForm.Link MasterFields = "WhateverID "

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympa tico.ca> schreef in bericht
news:Xn******** **************@ 207.35.177.135. ..
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.gotoRecor d
acNewRecor d.

a Save button sets me.dirty = false; me.AllowAdditio ns =
False a Cancel button sets me.undo; me.AllowAdditio ns = False

This works correctly.

I'd like to set me.DataEntry = True instead of goto the new
record, and that works fine, but when I set me.DataEntry
false during the Save or Cancel, the subform insists on
showing all records in the control source for the subform.
Setting me.filterOn hides the records except for the Main
record. I tried resetting the Link child fields property,
but that can supposedly be done at Form_Open

Any workarounds, advice?

--
Bob Quintal

PA is y I've altered my email address.


--
Bob Quintal

PA is y I've altered my email address.
Jan 11 '06 #4
Well I tried and Access told me to get lost.
I also tried to set the subform.form.fi lter (and .filteron) from the
current event in thje parent form.
No Go either.

I guess I'm gonna have to create a popup form, and use that.

Steve Jorgensen <nos...@nospam. nospam> wrote in
news:5M******** *************** *******@comcast .com:
I concur with Arno.
Thank you Steve and Arno. I'll try resetting the sourceObject.

I know that when I tried to reset the link_____Fields
properties, Access complained that they could only be changed in
design mode or in the parent's Form_Open Event..
I didn't think of changing the source object first.
There is definitely a problem in which changing some
properties of a subform can cause it to loose its link to the
parent form record, and reassigning the subform's recordsource
property does seem to fix the problem when this occurs.


Jan 12 '06 #5
I worked around the problem. I unlinked the subform, and set the query
to read the mainform's ID field and filter there.
Then I added a subform.requery in the mainform's OnCurrent Event.

Ugly way of doing it, but it works.

Jan 13 '06 #6
Hmmm, don't understand why it would not work for you Bob.
I am never resetting the original sourceobject but I am changing it and it works perfectly

Maybe something like
Me!SubForm.Sour ceObject = "" <== delete original string first to prevent 'caching-issues' or whatever...
Me!SubForm.Sour ceObject = "YourSourceObje ct" <==reset the sourceobject
Me!SubForm.Link ChildFields = "WhateverID "
Me!SubForm.Link MasterFields = "WhateverID "
works better??

Arno R
"rq******@sympa tico.ca" <bo*********@gm ail.com> schreef in bericht news:11******** *************@g 43g2000cwa.goog legroups.com...
Well I tried and Access told me to get lost.
I also tried to set the subform.form.fi lter (and .filteron) from the
current event in thje parent form.
No Go either.

I guess I'm gonna have to create a popup form, and use that.



Steve Jorgensen <nos...@nospam. nospam> wrote in
news:5M******** *************** *******@comcast .com:
I concur with Arno.


Thank you Steve and Arno. I'll try resetting the sourceObject.

I know that when I tried to reset the link_____Fields
properties, Access complained that they could only be changed in
design mode or in the parent's Form_Open Event..


I didn't think of changing the source object first.
There is definitely a problem in which changing some
properties of a subform can cause it to loose its link to the
parent form record, and reassigning the subform's recordsource
property does seem to fix the problem when this occurs.

Jan 13 '06 #7

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

Similar topics

1
1971
by: Filips Benoit | last post by:
Dear All, W2000 Office2000 Access adp SQLserver DB Problem: Adding a new property for a company in the subform. The FIRST time I Select a property in combobox CPROP_PRP_ID the subform act
2
12597
by: deko | last post by:
I have two subforms within a particular form. The one on top is a datasheet of transactions; the one on the bottom is a summary of totals. I would like to have the datasheet fill the entire parent form until a command button is clicked, then have the datasheet form shrunk to half it's original height and have the totals summary form appear below it. The totals summary sheet, then, would not be visible until the command button is clicked,...
1
2133
by: Tim Marshall | last post by:
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()
1
3273
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...
2
4287
by: David W. Fenton | last post by:
I think at various times we've all encountered this problem: A subform is on a main form. From the code of the main form we refer to some property of/control on the child form thus: Me!subForm.Form!txtTextBox and for some reason, in certain contexts, we get the error: Error 2455: You entered an expression that has an invalid reference
6
5967
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()
7
12297
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm thinking the Table will stay open otherwise ??? - Do I also need to use code to Assign the Child&Master Links, or can I just type the names into the subForms Control Property and just depend on the SourceObject to link to Table???
1
1820
by: EJO | last post by:
I've looked around the groups and don't have tried some of the various suggestions to no avail. So I'm hoping someone can help me out here. I have a form that, when a cmd button is clicked, changes the property of the form to dataentry. On this form, there are two fields that have a default value set. The one default value set using the property sheet is getting the value from a numeric field on a different form and is working just...
2
2074
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:
0
8440
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
8352
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
8780
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
8549
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
8636
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
7378
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
4192
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
2765
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
2
1763
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.