You can base the textbox on data from another table in several ways:
1. By using VBA code in the form's Current event to populate the control.
Me.txtMyTextBox = Nz(DLookup("[somefield]", "tblSomeTable", "some
criteria"), "")
2. By "binding" the textbox to another table's field, by adding the
following to the textbox's ControlSource property:
=Nz(DLookup("[somefield]", "tblSomeTable", "some criteria"), "")
With both options, the data is refreshed every time you move to a different
record. With option 2, the data is not updatable, because the control is
"bound" to the DLookup value.
3. You can include the other table's field in a query on which you can base
the form, and bind the textbox in the usual way.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
Ripper said:
I have a form that contains fields from 1 table, tblData.
I want a textbox on that form,txtRandomPoints, to be controlled by a field
on another table, tblPoints.PointsEarned.