|
-
May 7th, 2006, 06:33 PM
#1
Thread Starter
Member
[RESOLVED] Populating linked form field with parent form primary key
I am developing a form in Access which needs to have a linked form (rather than a subform), but it needs to be connected to the parent form by a foreign key. My problem is basically this, when I click the button on the parent form to filter the child form by primary key this works fine. But if there is no record available and the user wants to add one I want the foreign key on the child form to be automatically populated with the primary key from the parent form.
I have done this easily enough with a subform, does anyone know how I can achieve the same thing with a linked form?
Thanks for any help anyone can offer.
-
May 9th, 2006, 03:33 AM
#2
Re: Populating linked form field with parent form primary key
uhhh. If you are opening a form, you can pass OpenArgs property. Then on the form that is opened you can use the OnOpen/OnLoad Event(s) to fill as required.
Or you use
Code:
Forms("<formname>").Controls("<controlname>") = <value>
Once the child (linked) form has been opened from the parent form.
Does this help?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 9th, 2006, 06:12 PM
#3
Thread Starter
Member
Re: [RESOLVED] Populating linked form field with parent form primary key
Thanks. In the end I set the controls default property to the value on the parent form and then locked the control so the user could not change.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|