Solved

add new record from subform

Posted on 2013-06-28
5
742 Views
Last Modified: 2013-07-24
Hi Guys

I m going crazy with a simple subform

Main form
IDMain
date

Subform
ID
IDLink
field 1
field 2

relationship 1 to many enforced

I am displaying both forms and link field is IDMain --> IDLink

when i add a record in the subform, it is supposed save it and when i click new record on the main form it should create the id and add that id to the linked field in the subform, but that is not happening.
all other info is created in the subform but the linked field.

what is happening i have done this many times with no issues but now its taking me too long to figure it out what is happening.

Please help

thanks
0
Comment
Question by:titorober23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 250 total points
ID: 39285959
The Master Linking field is automatically added from the parent form to the child linking field in the sub form when a new record is added.

Make sure that the child linking field in in the sub form's record source. I usually add a bound textbox for the child linking field and set it to hidden.  You can make it visible to see if everything is working.
0
 

Author Comment

by:titorober23
ID: 39285975
the issue was that in the master i had 2 fields id and date, id was autonumber, date default value was set to now(), but because i did not change the date it was not creating a record on the master table- so when adding a new record i have to set the date in the field by code, set the focus in that control so the user must click on it so it could create the record, sounds a little weird, but it is because in the master i only have 1 field.
0
 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 250 total points
ID: 39286001
Yeah. You must insure the master record is generated before navigating to the sub form. This is an issue when the parent form's fields have a default value and the use wants to go directly to the sub form.

One solution is to have a save button on the parent form the saves/creates the record and unlocks the sub form.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39352495
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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