Populating a field

R

Ropesend

I've created a entry form which has a look-up field for the machineID. I
would like that when the user selects the machineID in the look-up; other
fields (location, model) are populated. Is it possible and what is the
process?

I have a query for the machine selection and used it to create a subform.
But this doesn't accomplish my goal. The information isn't captured inthe
main form's table.
 
A

Arvin Meyer [MVP]

Try adding columns to a combobox and populating textboxes using the combo's
column property (aircode):

Sub cboWhatever_AfterUpdate()
Me.txtTextbox1 = Me.cboWhatever.Column(2)
Me.txtTextbox2 = Me.cboWhatever.Column(3)
End Sub

Which will read the third and fourth columns from the combo box
 
R

Ropesend

I tried the combo box but it didn't provide me with what I wanted. It gave
the location on the form but it did not update the table's location, model.
Therefore, I created a separate table with the machine information; and
linked the machineIds. On my form, I let the text box fields update from the
lookup on the machineID field. Then run a query to print a report with the
information I needed. I shuld have mentioned the report. Your suggestion on
the combobox columns did present a new perspective. Thank you.
 
A

Arvin Meyer [MVP]

If you already have the data in 1 location, you never need to repeat it.
That's why a relational database is superior to flat files and hierarchal
designs. The only thing that ever gets repeated is the Primary Key of the
main table to the Foreign Key values of the subtables. IOW, a design like:

ID - PK
FirstName
MI
LastName
PhoneNumber

if used in a second table only requires the ID field. A query joining the 2
tables on the ID field will always display all the required information.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Top