There are two issues with the method suggested by
@MajP
1. It dirties the new record on the form. Most of the time this won't cause a particular problem because most of the time, the user will just complete the data entry. However, in the situation where the user fails to complete the data entry, you have two potential problems.
a. you create a record that is empty except for the FK. This is clutter at best but may cause other problems.
b. Assuming you have proper validation code to keep a user from saving an "empty" record, the user gets an error message when he closes the form complaining about missing data. The user KNOWS he didn't type anything so this tends to be very confusing to him.
2. If the process is such that you will need to enter multiple records, only the FIRST record created by the form will have the correct foreign key. Subsequent records will be created as orphans (if the FK is not defined as required) or the user will get an error that he won't be able to resolve because he can't enter the FK manually.
This method is called "push". I prefer to use the "pull" method.
In this case I pass the name of the form in the OpenArgs. Then in the BeforeInsert event of the called form, the called program gets the FK value and any other values it needs by directly referencing the calling form's controls. Using the BeforeInsert event means that your code never dirties the form. The BeforeInsert event runs when a user types the first character in a control and it runs once for EACH new record so it solves both of the above problems. The user already dirtied the record so he won't be confused by data validation error messages and the code runs for each new record so the called form can create multiple records with the same FK.
The downside of "pull" is that ALL forms that call this one, assuming the form can be called from multiple other forms, MUST all use the same names for the controls the called form will need to access.
An alternate to the "push" method is instead of populating a control with the pushed value, your code sets a default value for a control. That doesn't dirty the record. The record is not dirtied until the user types something. And, since you have provided a default, every record created will have the correct value populated for a hidden field like the foreign key/