Full Version: Subfom
UtterAccess Forums > Microsoft® Access > Access Forms
peterb49
I have a form (Clients) with subform (Events) and two subforms to Events (Job Parts & Job Labour). When the two Job subforms open they open to show existing record as does the subform Events. I want these two subforms to only open to add new records. How do I force them to do this. They do if I make Events Add new Record (Command Button). But I only want new records going in these two forms (but not the Events form). I have set Data Entry property of these forms to open to add data only, I have tried using a macro DoCmd-RunCommand-RecordsGoToNew when these forms get focus but it doesnt work.
Any suggestions would be appreciated
Jack Cowley
Set the Data Entry property of the forms in question to Yes. Now the forms will not show existing records and will be ready for data entry. You could also hide the suborms, leaving the data entry to No, and when a new parent record has been added then show the subforms. That way you will not see previous data.
th,
Jack
peterb49
I already have Data Entry property set to Yes, but it seems to be getting overridden by the Events Subform (which is the parent form for the two Job... subforms), Events is displaying an existing record until I click on Add New Record command button, then the two subforms initially show blank new record until data is added to Events then they revert to existing record
Jack Cowley
Hide the subforms that are dependent on the Events subform until you move to a new record in the Events subform. Then show the subforms or always have the Events subform in Data Entry mode, but it is dependent on the parent form so that may not be what you would like to do.
ack
peterb49
How do I hide the subforms?
Jack Cowley
A subform is a control on the form so it has a visible property under its Format tab. Click on the subform in question one time so that it has tiny black squares at the corners and midpoints of the line surrounding the control. Open the property sheet and set the Visible property to No. To change the visible property to yes you will have to do it programmatically when you are on a new record in the Events subform. This article will give you the syntax you need to properly refer to a control on a subform or subsubform.
th,
Jack
peterb49
Data Entry option on Events subform is not an option (there are too many labels with instructions on them). Is there no way I can force the two Job subforms to only accept new records? Any entries written to them go to a separate table ITEMS, which is viewable on a separate tabbed page as a datasheet anyway. But once more because of the amount of data on labels I cannot show the two Job subforms as datasheet
Jack Cowley
Do you have a Tab control on your form? Would that work for separating your subforms? Also, how about creating help popups instead so many labels with instructions? Once the user knows the program will they need all the current instructions?
ack
peterb49
Each of the Job subforms are on a separate tabbed page and at present I am getting around the problem by having a Next button that takes the form to a new record, but it would be so much simpler if I could force the form to gonly open to a new record. I have tried the On Click properties on each tab but that doesnt work either. I really appreciate your assistance with this.
Jack Cowley
You have to use the On Change event of the Tab Control to make the changes you need.
This is getting very complicated for me as you now have a tab control, subforms, subsubforms, etc. so I am not sure what to suggest. You could hide the tabs pages with the subsubform until there is data in the subform... That might be a solution, but I am grasping at straws as the form is becoming more complex with each post.... Not your fault as that is just how it is...
Jack
Aquadevel
Peter,
Since its getting complicated on what your end result is to be, can you possibly post your database <without any sensitive data in it>, Forms with Tabs/Subforms/SubSubForms can really be hard to 'follow', so we could possibly help you better?
If Jack thinks its 'complicated', know wonder his hair turned grey/white when he hit the 20K mark! frown.gif
good luck. frown.gif
Aqua
peterb49
Thanks for your offer. Any help is appreciated. I will send the database as two posts as it is a split database. You will have to edit the linked tables.
peterb49
This is the second post with forms etc
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.