It was worth a try. I hadn't tried it before because I understand Activate
to occur only when the form window becomes current after focus moves back to
it from another window, whereas I need the buttons to be updated when
scrolling from main form record to record. In fact, I use Activate to
Requery the subforms -- like your application, I don't update the subforms
directly, but call another form to do this. On return to the main form, the
subforms are requeried to update them according to the changes made in the
update form.
In fact, your comments made me realise that I also need to update the
buttons' visibility in the Activate event as well as the Current event (if I
delete the only row, then the subform will now be empty and the buttons need
to be hidden -- or if the subform was empty and I Add a record, the buttons
need to be made visible).
Anyway, I tried copying the button hide/show code into Activate, but it
still (mis)behaves the same way as in Current (after updating a subform
record). I guess that it was made to work this way for some reason.
The only workaround I can come up with is to include the buttons in each row
of the subform -- if you want to update or delete a record, you would have
to click the button in that row. The Add button could still be in the
footer as this should always be visible. Not a very elegant method.
However, I am sure that there must be a better solution out there
somewhere...
Thanks again for your help.
--
Cheers,
Lyn.
"Billie Kennedy Jr" <dannic@orpgs.com> wrote in message
news:1101926488.225361.12020@c13g2000cwb.googlegro ups.com...[color=blue]
>I had problems with some of my stuff disappearing as well. Or not even
> showing up properly. Right now I use Form_Current() for setting the
> default values of fields and properties for my form. Once the form is
> open I have all of the active code in Form_Activate().
>
> When a user chooses a record the form gets updated with the information
> needed. When the user chooses a new form that updates the contents of
> the first form and closes the new one then the first form is updated
> with the new information as well.
>
> I do have to say that the first form is an unbound form with no active
> fields. If the user wants to edit any of the information on the first
> form they have to open a different form. Those options are per user
> access set by a user table.
>
>
> Try the Form_Activate() function for your form instead of
> Form_Current().
>
> This helped me. It may help you.
> --------------
> Billie
>
http://www.orpgs.com
>[/color]