Go to Second record in subform with code 
Author Message
 Go to Second record in subform with code

Say I have a form (MyForm) with a datasheet subform (MySub) and in MyForm
I've got a command button.

Whenever I press the command button I want that little black arrow to go to
Record 3 in the subform ie the third record down showing in the subform
window.

I've looked up RecordSetClone, I've looked up Bookmark in Help including the
examples and doesn't make much sense to me for this.  What would the code
look like to do the above?  (PLEASE don't tell me to look in NorthWind.
That thing scares the pants off me!)
Ev



Mon, 09 Jun 2003 08:41:11 GMT  
 Go to Second record in subform with code
Evelyn,

You can try something like this:

docmd.gotorecord ,,acFirst

This will take you to your first record, then just repeat the following
line twice to take you to the third record:

docmd.gotorecord ,,AcNext

or you can try the same command with the OffSet property set:

DoCmd.GoToRecord , , acNext, 2

Lu.

Sent via Deja.com
http://www.deja.com/



Mon, 09 Jun 2003 20:34:03 GMT  
 Go to Second record in subform with code
Thanks but I really do want to go to a Record Number rather than using Next.
I'm going to substitute a variable (or is it a varient?) for the number
eventually.
Ev
Quote:

> Evelyn,

> You can try something like this:

> docmd.gotorecord ,,acFirst

> This will take you to your first record, then just repeat the following
> line twice to take you to the third record:

> docmd.gotorecord ,,AcNext

> or you can try the same command with the OffSet property set:

> DoCmd.GoToRecord , , acNext, 2

> Lu.

> Sent via Deja.com
> http://www.deja.com/



Tue, 10 Jun 2003 02:56:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Refresh form then go back to specific record on subform when closing a second form form

2. How to Go to Last Record in a Subform From VB Code in the main form

3. Syncronizing Second Subform With From First Subform (While showing multiple records)

4. Wait 1 Second Before going to next record

5. My screen goes dark for a few seconds every 5 seconds

6. Two Subforms/ Second subform using value from first subform

7. Refreshing subform data when new subform records inserted by code behind the main form

8. moving to the new record on a second level subform

9. Code fails on second record update

10. Code fails on second record update


 
Powered by phpBB® Forum Software © phpBB Group