By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,483 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,483 IT Pros & Developers. It's quick & easy.

Subform and .dataentry property issue

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.