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 - DoCmd.OpenForm "CyclistF", , , "[cyclistid]=" & Me![cyclistId2]
-
[Forms]![cyclistf]![RaceEntriesSF].DataEntry = True
Any suggestions
6 1477
Try this: - 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 ;)
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?
I missed the subform detail. It turns out that your guess was closer than mine :) Change your reference to the subform to - [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.
NeoPa 32,556
Expert Mod 16PB - [Forms]![cyclistf]![RaceEntriesSF].Form.DataEntry = True
or - [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.
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.
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?
Sign in to post your reply or Sign up for a free account.
Similar topics
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,...
|
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...
|
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...
|
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...
|
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.
|
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...
|
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...
|
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...
|
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....
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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,...
| |