Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make the cursor move automatically between records on the FORM

Status
Not open for further replies.

VladimirKim

Programmer
Jan 20, 2005
49
US
Hi,
I have a subform where there are few records. After I press the button on the parent form, I need the cursor to go through all the records on the subform. Line on the button's click event: DoCmd.GoToRecord acDataForm, "Sub_Hdetails1_Quote", acNext generates an error: "Sub_Hdetails1_Quote form is not open" even though it is open, but it's a subform within a parent form "Restabs". And, also, how would I find out the number of records in the subform without creating a recordset from sql statement?
Please, help.
Thanks
 
Hi
I think you need to use:
Code:
DoCmd.GoToControl "Sub_Hdetails1_Quote"
DoCmd.GoToRecord , , acNext
Where Sub_Hdetails1_Quote is the name of the subform control.
 
Oops, as for the number of records:
Code:
intCount = Me.Sub_Hdetails1_Quote.Form.RecordsetClone.RecordCount
Where Sub_Hdetails1_Quote is the name of the subform control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top