field in subform to field on main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform that contains several records. What I want to do is when a
record on the subform is double cliked, it fills that record into a field on
the main form. The subform is called "JE Codes subform1", and the field on
the main form is called "Reason". The Reason field is a combo box.

Thanks
 
Private Sub Form_DblClick(Cancel As Integer)
Me.Parent.Reason= Me.[Field 1] & " " & Me.[Field 2] etc.
End Sub
 
Cyberwolf said:
I have a subform that contains several records. What I want to do is when a
record on the subform is double cliked, it fills that record into a field on
the main form. The subform is called "JE Codes subform1", and the field on
the main form is called "Reason". The Reason field is a combo box.


This doesn't sound like a useful thing to do in most
situations. You can not trap an event for the entire
subform, you need to handle it on each section and control
in the subform. The subform's double click event wiil only
be fired if you double click on the record selector.

The code would look like:

Me.Parent.Reason = Me.Reason
 
Back
Top