Solved

Adding new records to subforms

Posted on 2014-10-22
4
214 Views
Last Modified: 2014-10-22
I am using Access 2007.  I have a form with about 25 fields and also 3 subforms.  I would like to link the subforms so the data automatically saves, but I also would like the subfroms to be clear of data when entering the new record.  Is there a way to do this?
0
Comment
Question by:ScootterP
  • 2
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
the very important thing to consider here is that,
the tables that you use as the record source of the subform must have a field that correspond to the UNIQUE record id field of the table that you use as the record source of your main form.

see this link  Create a form that contains a subform

take note on how to set the Master Fields and Child Fields property of the subform.



.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
Comment Utility
but I also would like the subfroms to be clear of data when entering the new record.
Access should handle that natively. If you move to a new record - for example, use DoCmd.RunCommand acCmdNewRecord - Access should automatically move you to a new record, and all the fields should be blank, unless you've defined Default values at the Table, Form or Control level.
0
 

Author Comment

by:ScootterP
Comment Utility
The record would not natively clear the records even when i used the new record command.  It would just take me the bottom of the records.

Scott
0
 
LVL 84
Comment Utility
It won't "clear" the existing records, but it would instead take you to the new record section. You really can't do what you're after unless you create a separate "Add Record" form, and that's somewhat clunky.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now