0
votes

Preface: I have a form which has tabs. In one of the tabs, I have a list box, a button, and a sub-form. The list box is populated from two tables and has a bound column.

Needed: I need the sub-form to edit existing records of one of the tables the list box is built on and append records to the same table on button click. The sub form is to be linked to the non-bound column of the list box. Please help.. I have tried a few things in Vb but could not complete..

--Chegu.

1

1 Answers

0
votes

I am not sure if I understand you correctly, but if you want to select a line in the listbox, edit the respective record in the underlying table and then save the record and update the listbox, you could work along those lines: The listbox should not be linked, neither should the subform. Create a procedure

Sub UpdateSubform()
  subform![id]=listbox!changetableID]
End sub

In the OnLoad event of the form and in the OnChange event of the listbox call this procedure

In the afterUpdate event of the subform:

  Private Sub Form_AfterUpdate()
    me.parent.requery
  End Sub

I didn't check this out myself, because I am away from my access - but it should work along those lines.

If thats not what you are looking for, please edit your post and at least post the information whats in the listbox and where your subform should link to.