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

Data_Entry in property sheet changes to NO when form opens

100+
P: 547
When i open a form from another form using a specific record, my data entry property in a subform is "automatically" set to false (no) it seems.

The 2nd form opens 100% on the correct record, but the data entry allows all previous records to be displayed. I need no records to be displayed in the subform.
I have tried this without success

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "CyclistF", , , "[cyclistid]=" & Me![cyclistId2]
  2. [Forms]![cyclistf]![RaceEntriesSF].DataEntry = True
Any suggestions
Nov 7 '13 #1
Share this Question
Share on Google+
6 Replies


Seth Schrock
Expert 2.5K+
P: 2,930
Try this:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm FormName:="CyclistF", DataMode:=acFormAdd, WhereCondition:="[cyclistid]=" & Me![cyclistId2]
I haven't tried it personally, but from the MSDN website, I believe that this has a chance of working ;)
Nov 7 '13 #2

100+
P: 547
thx Seth for the lightning fast response
It works but clears everything when it opens - the main form as well as the subform. How can i zoom in on subform only, but continue to show the parent form record? any suggestions?
Nov 7 '13 #3

Seth Schrock
Expert 2.5K+
P: 2,930
I missed the subform detail. It turns out that your guess was closer than mine :) Change your reference to the subform to
Expand|Select|Wrap|Line Numbers
  1. [Forms]![cyclistf]![RaceEntriesSF].Form.DataEntry = True
The way that subforms work is that a form resides inside a subform control. Your code referenced just the control. By adding the .Form after the form name, it references the form inside the subform control. Then you have access to all the form properties as well as the controls on the subform.
Nov 7 '13 #4

NeoPa
Expert Mod 15k+
P: 31,186
Expand|Select|Wrap|Line Numbers
  1. [Forms]![cyclistf]![RaceEntriesSF].Form.DataEntry = True
or
Expand|Select|Wrap|Line Numbers
  1. [Forms]![cyclistf]![RaceEntriesSF]!DataEntry = True
will both work (See Referring to Items on a Sub-Form).

Other questions, related or not, need to be asked in separate threads Neels.
Nov 9 '13 #5

100+
P: 547
thx Neopa - i meant to ask a related question. Seth's solution above cleared the subform as well as the parent form records, and i wanted to focus on the subform data entry property actially.
I have tried the above solutions but it still seem to do the same thing. Something else on my parent or subform must be affecting it somehow. i will probably have time tomorrow to try more options.
Nov 9 '13 #6

NeoPa
Expert Mod 15k+
P: 31,186
If it's further on the same problem - generally because the answers already there don't quite solve it - then that can come in the same thread. Otherwise, it really needs to be asked separately, even if you want to post a link to the original in your new thread, which is perfectly acceptable.

As for the current situation - Are you saying that the subform and the main form always seem to keep in step? IE. Whichever way one is set then the other necessarily follows.

If so, then this may be a fundamental design constraint within Access itself. It may be that it is considered not to make sense that they can be different. Frankly, I've never given the idea much thought.

Am I right in thinking you want the main form to show various records to choose from, but the subform to provide a means to enter only new data related to the selected record of the main form only?
Nov 9 '13 #7

Post your reply

Sign in to post your reply or Sign up for a free account.