Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2007, 07:14 AM
Authorized User
 
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Navigating data in a subform

I've successfully populated a subform from code on the main form using:

Me.frmSubJobList.Form.RecordSource = strSQL

but I can't see how to navigate the records. This approach looks hopeful..

    Me.frmSubJobList.Form.SetFocus
    DoCmd.GoToRecord , , acLast

But the first line generates the helpful error, "There is an invalid methond in an expression" !
Can anyone point me in the right direction please!

Thanks

Bob
 
Old February 1st, 2007, 08:59 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

When you say "navigate the subform" what are you trying to do? Subforms are usually dependant on the main form so the records in the subform only refer to a record in the main form, and navigation usually involves scrolling.

mmcdonal
 
Old February 1st, 2007, 10:58 AM
Authorized User
 
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks mmcdonal, my subform is not linked to the main form. I found the answer - I should have used Me.frmSubJobList.SetFocus rather than referring to the Form. This works fine!

Thanks again.

Bob





Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigating through the data in MySQL prad_a JSP Basics 1 March 23rd, 2007 07:48 AM
Navigating through the data in MySQL prad_a MySQL 4 March 23rd, 2007 01:58 AM
count data from subform Vince_421 Access 1 May 27th, 2006 11:51 AM
Subform on many to many data aware Access 14 August 12th, 2005 02:36 AM
Display data in a subform marcin2k Access VBA 1 March 1st, 2005 04:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.