Record Navigation in a Subform Datasheet

TheCrusher

New member
Local time
Today, 11:12
Joined
May 27, 2002
Messages
8
Does anyone know how to move to the next record in a subform datasheet using VBA?

I tried this but it didn't work:

DoCmd.GoToRecord acDataForm, "Forms!SerialTrack!SerialsSub2", acNext

Any ideas???
 
I've already tried that as well. Maybe my syntax isn't correct. When I try to navigate it tells me my subform isn't open. Funny thing is, if I open my subform by itself, I can navigate through the records from the main form button I created - it works only if the standalone subform is open in behind.
 
Rich,

I got it!

I was writing the following code:

Forms!SerialTrack!SerialsSub2.SetFocus
DoCmd.GoToRecord , , acNext

This didn't work.....but
______________________________________

....after your posting, I re-thought my process and did it like this:

Dim varSub2 As Control
Set varSub2 = Forms!SerialTrack!SerialsSub2
varSub2.SetFocus
DoCmd.GoToRecord , , acNext

This works!
Thanks for your help Rich!
 
Thanks to both of you! I wasn't trying to exactly the same thing but your code helped me figure out my issue. :)
 

Users who are viewing this thread

Back
Top Bottom