[AccessD] A2K: Go to Record on Subform

Andy Lacey andy at minstersystems.co.uk
Mon Jul 7 01:47:22 CDT 2003


Hiya Darren. How're you doing?

My suggestion on this would be to use the RecordsetClone of the subform.
This sort of thing:

Dim rst as Recordset

Set rst = Me.subFormControlName.Form.RecordSetClone
rst.moveNext
Me.subFormControlName.Form.BookMark=rst.Bookmark
rst.close: set rst=nothing

You're going to need error handling to look after there being no
records, or already being on the last record. You can also set this up
as a single function and pass a param to say which move you want to do.

But someone may well have a simpler solution.

See ya.

Andy Lacey
http://www.minstersystems.co.uk







> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com 
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
> Sent: 07 July 2003 07:39
> To: Access Developers discussion and problem solving
> Subject: [AccessD] A2K: Go to Record on Subform
> 
> 
> Hello all
> I have a subform on my main form (frmMain) called MySubForm
> But I don't want the Nav Buttons on the subform Visible. So 
> ...I wanna set up generic navigation buttons on frmMain
> 
> The gotcha is MySubForm dot SourceObject will vary between 3 
> forms designed to be sub forms. EG sub_frm_Suppliers, 
> sub_frm_Products and sub_frm_Categories. So depending if the 
> user clicks the Categories, Suppliers or Product buttons on 
> frmMain the 
> MySubForm dot SourceoObject will equal the relative button clicked.
> 
> Then I want the generic Nav Buttons on the Main form to 
> control the record movement on the sub form
> 
> Clear as mud :-))
> 
> Any suggestions on syntax??
> 
> Many thanks in advance
> 
> Darren
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com 
> http://databaseadvisors.com/mailman/listinfo/a> ccessd
> Website: 
> http://www.databaseadvisors.com
> 



More information about the AccessD mailing list