473,387 Members | 1,579 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,387 software developers and data experts.

Data_Entry in property sheet changes to NO when form opens

547 512MB
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
6 1477
Seth Schrock
2,965 Expert 2GB
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
neelsfer
547 512MB
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
2,965 Expert 2GB
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
32,556 Expert Mod 16PB
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
neelsfer
547 512MB
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
32,556 Expert Mod 16PB
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

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

Similar topics

1
by: P51D | last post by:
I have a listbox in the headere of a form with the details below. Once the form's open it works properly, allowing me to select a record and see the related details. On opening the form,...
7
by: jim Bob | last post by:
Hi, I have a search form and upon double click on a name in the list box, a Candidate details form pops up. (no edits etc allowed, only viewing). I have a second form in dataentry mode which is in...
6
by: nickybon | last post by:
Hi fellas, Im setting up a form in my Access project and I need to implement this rather special fucntion. This function is basically simple to understand but I really dont know how to create...
8
by: erick-flores | last post by:
Hello all My code used to work, but now its not working any more. What I am trying to do is find the current user when a forms open. This is the code that used to work: If...
2
by: JohnM | last post by:
When a form opens, the most recently used filter is retained. How do I set it to clear the grid when it opens (or when it closes for that matter)? I'm using docmd.openform to open it.
1
by: teneesh | last post by:
I have designed a form that should display continuous records in the detail. Everytime a user (including myself) click on the view button to view the detail, it does not display until I stretch the...
1
by: lchomany | last post by:
Good Day! I have a macro created to Open my subform and is embedded in the Command Button. Main Form: frmADD NEW ENTITY NAME Subform: frmEntityAwards My macro filters to the specific...
3
by: Elphaba31 | last post by:
Hello Gurus, I have been tasked with correcting issues with our upgrade(Access97/2000 to Access2007) and essentially know very little about Access (any version) or Visual Basic. Here is my current...
3
by: neelsfer | last post by:
I would like to clear the data displayed in a subform with VBA using a button, similar to when you have the DataEntry property set to NO, and then has to close and open a specific form, to clear it....
3
by: Knowlton | last post by:
I have two forms that the primary key field(autonumber) populates when the form opens or you move to a new record. This doesn't matter on one since it is a stand alone form but the other is a...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
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,...

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.