Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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
  #1 (permalink)  
Old December 26th, 2007, 03:02 PM
Registered User
 
Join Date: Dec 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing unique record from form to form

I'd appreciate any direction with the following. I have an Access database and am developing a VB6 interface for adding / editing data. I've followed most of the chapters in John Connell's book "Beginning VB6 Database Programming" and have a functional user interface. I want to limit users' navigation (and adding/deleting records) in the recordset to the initial form/window, and then pass the location of a specific record through the remainder of the program. I can't find anything in the book which explains how to lock into that specific record. My subsequent forms are all set up, but I obviously don't want the user to have to re-find a specific record with each form. I see something about using a "bookmark" but I don't know if that's the way to go. As you can tell, I'm a novice programmer, and not quitting my day job anytime soon. Any direction with this is much appreciated. Thank you in advance.

  #2 (permalink)  
Old January 2nd, 2008, 06:20 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

You will probably want to look up the record within each object that will use it. Relational databases can retrieve a record really fast if you can make the parameters simple. If each record has a unique ID, the "WHERE ID = ...." is a really quicjk lookup.

The bookmark is valid only for the recordset in which it is contained--it is a pseudo-column. When a recordset is opened, each record in the recordset is assigned a unique bookmark. You can use that bookmark to quickly find a record in the recordset to which it belongs, but it is not part of the actual data.

You can make a globally dimmensioned recordset, which will then be available to any object in the global scope, and prehaps that, too, will work for you.

You can declare it globally, and open it within a certain form or procedure. Once open, any form, procedure or object can then access it. This is usually not the best approach; it quickly gets involved to keep track of the global recordset's status.


Similar Threads
Thread Thread Starter Forum Replies Last Post
unique attribute names for form elements fishmonkey XSLT 3 March 16th, 2008 07:46 PM
how to ceate a unique number on a web form abhishek0807 ASP.NET 2.0 Basics 4 March 5th, 2007 07:47 AM
how to display a unique number in a web form abhishek0807 ASP.NET 2.0 Professional 0 March 4th, 2007 02:12 PM
Passing FORM to FORM to PHP AV1611 PHP Databases 1 August 17th, 2005 03:32 PM
Passing Value from main form to Popup Form smartgir Access VBA 0 February 26th, 2004 06:26 PM





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