Wrox Programmer Forums
|
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
 
Old February 18th, 2010, 11:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Solving the problem for you will not teach you anything.

Do you understand variables scope?

A variable live in a "world" and then dies. When you do a dim the object start to live, and somewhere it dies. The scope, means that the object is visible to some functions or not, or even part of the code.

google it. There is a lot of explain of it. You should leave the DAO driver, and check the scope.

Here you have the quick solve, change this two lines.

Call CreateContactTable (db)

Public Sub CreateContactTable(db as DAO.Database)

but please read something to understand why.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old February 20th, 2010, 06:44 AM
Authorized User
 
Join Date: Mar 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up ukbrad

Bingo! As soon as you mentioned various I knew what was wrong; I had completely forgotten that variables have limited 'life' outside a procedure and need to be declared separately. I've done this and the program now works fine.

I am really most grateful for your valuable help, I have learned a lesson that I will not forget in along time!

Thankshttp://p2p.wrox.com/images/icons/icon14.gifhttp://p2p.wrox.com/images/icons/icon14.gifhttp://p2p.wrox.com/images/icons/icon14.gif
Tony Bradley
__________________
A R Bradley





Similar Threads
Thread Thread Starter Forum Replies Last Post
database and vb6 Probie VB Databases Basics 3 August 2nd, 2007 01:14 PM
Help With Searching Database (VB6.net) colm VB Databases Basics 0 June 5th, 2007 03:17 PM
Database Printing Recordset VB6 Hondacars VB How-To 1 March 11th, 2006 06:15 AM
URGENT help needed with VB6 database bassace VB Databases Basics 24 June 13th, 2005 01:08 PM
Database problems with mySQL and VB6 rgtuplin Pro VB 6 3 February 4th, 2004 04:06 PM





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