p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB Databases Basics (http://p2p.wrox.com/forumdisplay.php?f=82)
-   -   tables and fields listboxes (http://p2p.wrox.com/showthread.php?t=89721)

Flipper March 28th, 2013 12:39 PM

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!

JohnWills August 2nd, 2013 08:03 AM

I am confused why this is happening.


All times are GMT -4. The time now is 03:31 PM.

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