Yes, the Change event fires when the Text of the textbox is changed, not
when the Value is changed. The default property of the textbox is .Value, so
when you don't specify a property, that's the one you get. To use the .Text
property though, the control has to have the focus.
There are a few ways around this.
1) Place the code in the Change event into a separate procedure that you can
call from the Change event or the Double Click event. Call this procedure
from the double click event after you change the value of the control on the
main form. The procedure would be one in the (General) section of the code
window and would be defined as Public.
2) Change the Change event from Private to Public. You can now call it
directly from the subform in the double click procedure.
Example:
Call Me.Parent.Text1_Change
3) Copy and paste the code from the Change event into the Double Click
event, adjusting for the location the code will now be running from (i.e.
subform instead of main form).
--
Wayne Morgan
MS Access MVP
"Dee" <wo********@comcast.net> wrote in message
news:35**************************@posting.google.c om...
I have a field "TerritoryID" on a subform. It has a Dbl Click event as
follows:
Private Sub TerritoryID_DblClick(Cancel As Integer)
Forms!FmDealer5!Text152 = DealerID '**Retrieves DealerID and
loads unbound Text152 on parent form
Forms!FmDealer5!Text154 = Forms!FmDealer5!DlrId '**Loads current
parent form's DlrId into unbound Text154 on parent form
End Sub
This part works fine
I have unbound Text152 on parent form. It has an 'On Change' event as
follows:
Private Sub Text152_Change()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[DlrId] = 1004" '& [Me!Text152]" ** use after
hard coded number works
'Stop '**Test Only
Me.Bookmark = rs.Bookmark
End Sub
This part never executes. Anyone know why?
My ultimate goal is move to the Text152 record on the parent form,
then have a Command button return me to the previous record.