tags:

views:

29

answers:

1

Hi,

I am new to VB programming. I have 2 forms(2 windows). In first window,I have a tree view (the childs are the tables in DB.). On click of a any child, a list view(the data present in the table ) will be displayed on the right side of the tree view.

On double clicking on any row in the list view, another form will be opened. The current requirement is to display the data in the listview in form2 opened on double clicking a single record.

Private Sub LV_DblClick()
    Dim a As New Form2
    Display_Temp_DATA

    a.Show vbModal
End Sub

LV_DblClick() is in the form1 and it opens the form2. Now, Display_Temp_DATA has sql query which fetches the record from the table and should be displayed in a list view in form2.

Private Sub Display_Temp_DATA()
On Error GoTo errHandler

'Dim liItem As ListItem
'Set liItem = a.ListView1.ListItems.Add(, , "Abcd")
Display_List_Two_Data "Select  start, stop FROM tblsignal"
    Exit Sub
errHandler:
    MsgBox Err.Description
End Sub

I am able to open the form2, but I am finding difficult to display the data in the form2 list view. Please help me in solving this.

Thanks

Ramm

+1  A: 

you can add module and variable to it and assign the value to that variable access it on the target form. not sure but you can also use FormName.VariableName for static variable on the form.

Vinay Pandey