Suggestion on populating form with info from subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform (subAssetCheckOut) and I would like to take the information
from one field (EmployeeID) and populate that information in an unbound field
in the parent (frmAsset) form. What would be the EASIEST way to do this. If
you suggest the DLookup function PLEASE give me a painfully detailed example
of the code. I know this doesn't make any sense (wanting to populate an
unbound field in a parent form with information from a subform that's already
displayed), but please humor me. Thank you.
Carrie
 
In the current Event of the subform place

Sub Form_Current()
Dim MainForm As Access.Form
Set MainForm = Me.Parent.Form
MainForm!EmployeeID = Me!EmployeeID
End Sub

HTH
Pieter
 
I have a subform (subAssetCheckOut) and I would like to take the information
from one field (EmployeeID) and populate that information in an unbound field
in the parent (frmAsset) form. What would be the EASIEST way to do this. If
you suggest the DLookup function PLEASE give me a painfully detailed example
of the code. I know this doesn't make any sense (wanting to populate an
unbound field in a parent form with information from a subform that's already
displayed), but please humor me. Thank you.
Carrie

Bear in mind that the Subform could contain a hundred records, each
with a different EmployeeID... but...

No DLookUp is needed. If the name of the Subform COntrol is
subAssetCheckout (it might not be; the name of the *control* can be
different than the name of the Form within that control) put a textbox
on the mainform with its Control Source set to

=subAssetCheckout.Form![EmployeeID]


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top