Suggestion on populating form with info from subform

C

Carrie

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
 
P

Pieter Wijnen

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
 
J

John Vinson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top