ListItem

M

mattyboy150279

Hi.

Im using the ListView control in Access. The control lists a series of
tables within a selected database. When I double click on the listview
I want it to populate a separate listview with all the information in
that table in listview format.

The code I have below doesnt work. The problem I get is on the "Setrs
= ...." bit. Where am I going wrong?

My code is below:-

Private Sub lvwTables_DblClick()

Dim i
Pag2.SetFocus
Dim oItem As ListItem

Set oItem = lvwTables.SelectedItem


Set rs = db.OpenRecordset(oItem)


For Each i In rs.Fields

lvwTables.columns.Add (i.Name)

Next


End Sub
 
M

mattyboy150279

Hi.

Its supposed to be the clicked on item in the listview control. I
know I've done it wrong, and I also know that I've managed to pull this
off before I just cant remember how.

Thanks for your help.
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top