Solved

add new record from subform

Posted on 2013-06-28
5
746 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 48

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

617 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