What does this mean?

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Private Sub Form_Got()
Me.subHorseDetailsChild.Form.Recordset.MoveLast
End Sub

Thanks for any Help!....Bob
 
That code must be contained in a module associated with a form that has a
subform on it. The name of the subform control is subHorseDetailsChild
(depending on how the subform was added to the parent form, it's possible
that the form that's used as the subform may be named something else).

That particular instruction is saying to move to the last row in the
recordset of the subform.
 
Private Sub Form_Got()
Me.subHorseDetailsChild.Form.Recordset.MoveLast
End Sub

I assume you mean:

Private Sub Form_GotFocus()

as there is no "Got" event of a form ...

Assuming it's the GotFocus event, this means that whenever your form receives the Focus (you click on it, for example),
the data in the subHorseDetailsChild subform will move to the last record. You need to be careful with GotFocus, since
it doesn't always fire. This is from the MSDN onlilne reference:

"A form can receive the focus only if it has no controls or if all visible controls are disabled. If a form contains any
visible, enabled controls, the GotFocus event for the form doesn't occur."

So unless this form has no controls Visible, or unless all visible controls are disabled, there is no guarantee that
your code will fire.

Here's a link to the GotFocus reference:
http://msdn2.microsoft.com/en-us/library/aa165410(office.10).aspx

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top