Put the following code in the click event of one or more fields in your
subform:
DoCmd.OpenForm "NameOfYourNewForm",,,"[RecordID] = " & Me![RecordID
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com
"Coll" <co*********@hotmail.comwrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
>I have a form with a subform on it. On my main form, you select an
employee id number and the top portion of form fills in with data, and
the bottom portion of the form,which is a subform, lists existing
records there are for that employee (one to many relationship). How
can I set up my main form, so the user can select one of the records
on the subform and retain that recordid number for use in opening a
new form and displaying the that record?
I tried creating a text field and populating it when a record is
selected (ongetfocus) - Me!Text17 = frm!frmExistingLeavesSubForm!
RecordID
Doesn't seem to work - error message - runtime error 424 - object
required. Is this the right approach or is there a better way to do
this?
Thanks.