Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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.

Reply With Quote
  #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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:51 PM.


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