First off - your FIELDS ( which are in the underlying table ) must already be 'populated' - otherwise where will you get your data from.
What you really want to do is 'populate' the CONTROLS on the form
Have the form laid out with all the controls named as appropriate but UNBOUND
Have the ComboBox's RowSource pointing to the table where the data will come from with the combo box Bound Column as the underlying table's primary key
Then in the combo boxes AfterUpdate event
Open a Recordset on the underlying table using the Where clause of
"WHERE tblPrimeKey = " & cboBoxName
Then step through all the fields in the recordset setting
Control1 = rst!Field1
Control2 = rst!Field2
etc.. ..
etc.
Alternative:-
Have all the controls BOUND to their respective fields but then make the FORM's RecordSource = Null
Then in the comboBoxes AfterUpdate event have something like
Code:
Dim strSQL As String
strSQL = "SELECT * FROM tblName " _
"WHERE tblPrimeKey = " & cboBoxName
Me.RecordSource = strSQL
Either option has advantages depending on what you are doing.
If you want to update info into the table easily use the 2nd option.
'ope-that-'elps
G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.