Which event might work?

  • Thread starter Thread starter Deborah
  • Start date Start date
D

Deborah

I have a master form and a subform. The PubID is the link
between the two. On the subform the PubID is a textbox.
Currently I can watch it change when I change the PubID on
the main form. However what I can't get to happen is when
the PubID changes on the subform, is an event to happen. I
have tried in the code using AfterUpdate, Changed, Enter
and GotFocus relating to the textbox where the PubID lives
and it never goes into that bit of code. I.e.

private sub Text28_AfterUpdate()
dim pid as long
pid = me![PubID].value
etc

It never gets to the pid = me! line. How can I get
something to happen when the PubID in the subform changes?
And yes it has to be in the subform.

Thanks

Deborah
 
Are you trying to move subform records? I'm not clear about what the PID is?
If you want to move sub records to other main records, why weren't they
placed correctly first time around? If you aren't moving records, the PubID
should not be shown because it's confusing to users. In any case, the
AfterUpdate event should fire when you alter its data and could contain a
requery, or the SQL of the subform... which would update the records
shown...

HTH.

Tom.
 
Deborah,

You need to use the Afterupdate event on the PubID on the
main form. Ideally the pubID on the subform would not be
displayed because it's purpose on the subform is to link
records on the subform to the main form. Under most
circumstances there is no reason to have such a field
editable or visible. Making the field not visible would
also simplify the look of the form for the user. The form
would also be less crowded.

I hope that helps!

Kevin
 
Nope, not trying to move subform records and the only
reason I am showing the PubID right now is so that I can
see that it worked. I am trying to create a record set
based on the new PubID, but so far haven't been able to
persuade the subform that the PubID changed to get the
recordset going. I tried AfterUpdate and still didn't get
into that chunk of code....
-----Original Message-----
Are you trying to move subform records? I'm not clear about what the PID is?
If you want to move sub records to other main records, why weren't they
placed correctly first time around? If you aren't moving records, the PubID
should not be shown because it's confusing to users. In any case, the
AfterUpdate event should fire when you alter its data and could contain a
requery, or the SQL of the subform... which would update the records
shown...

HTH.

Tom.

I have a master form and a subform. The PubID is the link
between the two. On the subform the PubID is a textbox.
Currently I can watch it change when I change the PubID on
the main form. However what I can't get to happen is when
the PubID changes on the subform, is an event to happen. I
have tried in the code using AfterUpdate, Changed, Enter
and GotFocus relating to the textbox where the PubID lives
and it never goes into that bit of code. I.e.

private sub Text28_AfterUpdate()
dim pid as long
pid = me![PubID].value
etc

It never gets to the pid = me! line. How can I get
something to happen when the PubID in the subform changes?
And yes it has to be in the subform.
.
 
The problem is that I am making a recordset and then I
need to filter it based on the subform (there will lots of
subforms all filtering the same recordset), so I can make
the original recordset based on the PubID of the main
form, but then need a way to further refine the recordset
based on info in the subform. This is after it loads/opens
so that doesn't work. Help?
-----Original Message-----
Deborah,

You need to use the Afterupdate event on the PubID on the
main form. Ideally the pubID on the subform would not be
displayed because it's purpose on the subform is to link
records on the subform to the main form. Under most
circumstances there is no reason to have such a field
editable or visible. Making the field not visible would
also simplify the look of the form for the user. The form
would also be less crowded.

I hope that helps!

Kevin
-----Original Message-----
I have a master form and a subform. The PubID is the link
between the two. On the subform the PubID is a textbox.
Currently I can watch it change when I change the PubID on
the main form. However what I can't get to happen is when
the PubID changes on the subform, is an event to happen. I
have tried in the code using AfterUpdate, Changed, Enter
and GotFocus relating to the textbox where the PubID lives
and it never goes into that bit of code. I.e.

private sub Text28_AfterUpdate()
dim pid as long
pid = me![PubID].value
etc

It never gets to the pid = me! line. How can I get
something to happen when the PubID in the subform changes?
And yes it has to be in the subform.

Thanks

Deborah


.
.
 
Back
Top