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 > VB Databases Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 Display Modes
  #1 (permalink)  
Old March 28th, 2013, 12:39 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default tables and fields listboxes

I am using a form with two list boxes to provide the user with query building tools. The form should list the tables(lstbx1) and the fields(lstbx2) and allow user to make selections thus creating a query.
As simple as it should be, I cannot get lstbx2 to list the fields from a table selected in lstbx1.

I have this on Form load:
Private Sub Form_Load()
Dim db As Database, tbl As TableDef
Set db = CurrentDb

For Each tbl In db.TableDefs
If Left$(tbl.Name, 4) <> "MSys" And Left$(tbl.Name, 5) <> "VALID" Then
lstTables.RowSource = tbl.Name & "; " & lstTables.RowSource
End If
Next
End Sub

But I get a null error when I select a table name from list 1

Any ideas would be greatly appreciated!
Reply With Quote
  #2 (permalink)  
Old August 2nd, 2013, 08:03 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am confused why this is happening.
Reply With Quote
Reply


Thread Tools
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
Compare two fields from different tables pallone SQL Server 2000 10 March 23rd, 2007 05:14 PM
Listboxes Sub-Listboxes and Table Linking MJB05 Access 4 September 20th, 2005 12:37 PM
Blank fields - queries with many tables dvarrin Crystal Reports 0 February 1st, 2005 04:43 AM
Pooling fields from two tables into one view eoffshore SQL Language 4 August 2nd, 2004 05:42 AM
fields from tables to update damnnono_86 Access 3 November 5th, 2003 03:07 AM



All times are GMT -4. The time now is 02:06 AM.


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