Opening subform after entering new record (1 Viewer)

scubadiver007

Registered User.
Local time
Today, 01:02
Joined
Nov 30, 2010
Messages
317
What is the best way to open a linked subform using a button while in a newly created record?

I thought a simple

Code:
docmd.save

command would do (either in the "current record" or the "after update" event)

Thanks
 

jdraw

Super Moderator
Staff member
Local time
Today, 04:02
Joined
Jan 23, 2006
Messages
15,415
Do you have 2 tables related in a 1 to many relationship, and do you have the 1 table as recordsource for the Form, and the Form/Subform related using Linkfields,
and you add a new record to the Form, and then you want to go to the subform.
You can not add a record to the subform if there is no parent record in the parent form.
 

scubadiver007

Registered User.
Local time
Today, 01:02
Joined
Nov 30, 2010
Messages
317
Do you have 2 tables related in a 1 to many relationship, and do you have the 1 table as recordsource for the Form, and the Form/Subform related using Linkfields,
and you add a new record to the Form, and then you want to go to the subform.

Yup, that is indeed what I want to do but the record is not saved if I press the subform button while in the record.

So presumably the record needs to be requeried or saved in some way.
 

scubadiver007

Registered User.
Local time
Today, 01:02
Joined
Nov 30, 2010
Messages
317
I have attached a db with two tables and their corresponding form and subform. When I enter a record into the form and open the subform I would expect the corresponding "cand_ID" number in the subform to appear but it remains zero.

BTW, I've never really used linked subforms so this is a bit new to me.
 

Attachments

  • Form_and_linked_subform.mdb
    696 KB · Views: 86

Users who are viewing this thread

Top Bottom