98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Access forms/subforms
Access forms/subforms
Resolved · High Priority · Version 2003
Adele has attended:
Access Intermediate course
Access Advanced course
Access VBA course
Access forms/subforms
I've set up a form and subform...
In the form you enter employee name and date and then the subform populates timesheet information (i.e. job number, activity performed, hours spent).
1. If I open the form in "Add form" view, then a blank record is automatically added to the subform.
2. If I open the form in "Edit form" view, then:
(a) If there are no records to find, then the subform is populated with the first record in the table (which has now been edited incorrectly with the name/date entered in the form).
(b) If there are records to find, the subform is populated with those (correct) records plus the edited (incorrect) record.
How do I stop both of these 2 things happening?
RE: Access forms/subforms
Hi Adele
Thank you for your question
I am assuming that you have built the subform using the wizards. If this is so, then you might well be better using a variation of the technique we covered on the VBA course.
Create an SQL string based upon the required time sheet information.
You will have to create a series of variables, set their values equal to the values of controls on the main form. You will then have to embed them into an SQL string.
You can then set the control source of the subform to that string.
If the recordset is empty, then you could simply set a condition to hide the sub form.
Hope this is helpful, if it doesn't work please get
back in touch
Regards
Stephen
Mon 19 Oct 2009: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Deleting duplicate records from a tableYou cannot delete records tables where there duplicate records. A way around this is to create a new table which wont hold the duplicates. and then deleting the old table. |