Controlling record pointer of subform

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

Guest

I have an unbound form named fMain01. It has a subform object named
subfrmCOA. The subfrmCOA SourceObject is form fSubData01 whose recordsource
is a query qCOA001. subfrmCOA on fMain01 has no Linked Child Fields and no
Linked Master Fields.

Issue: I want to create a command button that when I click it the record
pointer in subfrmCOA will go to the first record. Example is lets say I have
scrolled down to record 300 and click on it. When I click the command button
then subfrmCOA should go back to it's record one. Note: I do not want to
use the navigation buttons for this. I need control outside the navigation
buttons.

It was suggested to me to do the following on the [EventProcedure] on the
OnClick event of a Command Button on form fMain001:

Me.subfrmCOA.Form.Recordset.MoveFirst

but when I do this I get an error: Application-defined or Object-defined
error.

Can anyone please help me with this?

Thank you,

Steven

PS: If it helps at all in a solution I did later out of frustration add an
ID field in the subform that returns a records line number in the subform.
I got this code out of the MSKnowledgeBase about how to add line numbers to
your subform. I just mention it in case the solution goes in this direction.
Thanks again.
 
Sounds to me as though, since your subform is based on a query, you need to
sort your query to get the record order the way you want
 
That is not the issue:

The records are already in the correct order. I want to be able to move the
record selector back to the 1st record but not by using the navigation
buttons. I want to do it on the OnClick of a Command button. For Example:
If I have scrolled to the 300th record and click it therefore moving the
record selector to that record, then I want to be able to click the
CommandButton and move back to the first.

Steven
 
Back
Top