Floyd,
Yes, it would go into the main form's coding module. You'd replace
[MySubformControl] with the name of the subform control on the main form.
Depending on how you set up your form, the subform control may or may not
have the same name as the subform. To check the name of the control, click
once in the very upper left-hand corner of the control, and then go to the
menu bar and click View | Properties. This will bring up the property sheet.
Across the Title bar of the property sheet, it should read:
Subform/Subreport: 'the name you want'.
It also works by simply typing Me. in the VBA editor. The period following
the Me will activate the Intellisense feature. You'd just scroll down the
list until you find a word which resembles what you think is the name of
your subform.
HTH,
Brian
Floyd said:
Brian,
I'm very new to all this. What do I replace [MySubformControl] with. Also,
do I use the Main Form Activate event procedure to place the code.
Floyd
Brian Bastl said:
Floyd,
Try using the form's Activate event procedure. You'll first need to set
focus to the subform control, and then go to the last record.
Me.[MySubformControl].SetFocus
DoCmd.GoToRecord , , acLast
Brian
I have many Main Forms, each has a subform for data entry. When I switch
to a
main form I want cursor to go to last record on that subform. The go to
command does not work for me. Can someone help me with the code.
Thanks,
Floyd