473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

a Save button sets me.dirty = false; me.AllowAdditions = False
a Cancel button sets me.undo; me.AllowAdditions = 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 5579
Bob,
Try (re)setting the sourceobject for the sub
Something like
Me!SubForm.SourceObject = "YourSourceObject"
Me!SubForm.LinkChildFields = "WhateverID"
Me!SubForm.LinkMasterFields = "WhateverID"

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympatico.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.gotoRecord acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditions = False
a Cancel button sets me.undo; me.AllowAdditions = 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.SourceObject = "YourSourceObject"
Me!SubForm.LinkChildFields = "WhateverID"
Me!SubForm.LinkMasterFields = "WhateverID"

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympatico.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.gotoRecord acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditions = False
a Cancel button sets me.undo; me.AllowAdditions = 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.SourceObject = "YourSourceObject"
Me!SubForm.LinkChildFields = "WhateverID"
Me!SubForm.LinkMasterFields = "WhateverID"

should work IMO (and IME).

Arno R
"Bob Quintal" <rq******@sympatico.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.gotoRecord
acNewRecord.

a Save button sets me.dirty = false; me.AllowAdditions =
False a Cancel button sets me.undo; me.AllowAdditions = 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.filter (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.SourceObject = "" <== delete original string first to prevent 'caching-issues' or whatever...
Me!SubForm.SourceObject = "YourSourceObject" <==reset the sourceobject
Me!SubForm.LinkChildFields = "WhateverID"
Me!SubForm.LinkMasterFields = "WhateverID"
works better??

Arno R
"rq******@sympatico.ca" <bo*********@gmail.com> schreef in bericht news:11*********************@g43g2000cwa.googlegro ups.com...
Well I tried and Access told me to get lost.
I also tried to set the subform.form.filter (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
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
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...
1
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...
1
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....
2
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: ...
6
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...
7
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...
1
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,...
2
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
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.