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!

movenext form a second form 2

Status
Not open for further replies.

jeffmoore

Programmer
Aug 29, 2003
301
US
How do i do a .movenext function on form A from form B??
 
Try:
[tt]docmd.gotorecord acdataform,"A",acnext[/tt]

Roy-Vidar
 
okay but my form A is a sub form....

DoCmd.GoToRecord acDataForm, "[forms]![frm_training_matrix]![qry_training_details_sub subform]", acNext

and the above syntax give me the error ..." form "[forms]![frm_training_matrix]![qry_training_details_sub subform]" isn't open .... yet it is

 
Should have said that, completely different animals;-)

Set focus to it first, then issue the command without objecttype and objectname arguements.

[tt]me![qry_training_details_sub subform].setfocus
docmd.gotorecord,,acnext[/tt]

- note, this requires that the subform name and the subform control name is the same, else be sure you're using the latter.

Roy-Vidar
 
okay but the control name is "txt_testtype" .... and I can rename the control at this point.
 
Is the subform control name txt_testtype, then use it in the reference. If the txt_testtype is the name of a control on the subform, let's forget it for the time being.

A subform isn't recognized as an open form, it exists as a control on the main form (together with text controls, combo controls...). When referencing subforms, and controls on a subform, one must refer using the subform control name, which may differ from the subform name as viewed in the database window. Here's some info from Microsoft How to refer to a control on a subform or subreport in Access 2000.

If my above suggestion doesn't work, eaasiest way of obtaining the correct subform control name, is to enter a control on the main form, then use the expression builder to doubleclick thru forms, loaded forms, main form, subform and a control on the subform. The resulting reference will contain the correct reference to use...

Roy-Vidar
 
he - he - yeah, subform referencing is among the more entertaining things when working with Access;-)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top