Hi my first post. great resource.

This is my first real VB project. Please dont laugh at my code. Im a
newbie.


The part I cant figure out is this:

These are the relevant objects:
Form 1 (ufCombIns) has a commandbutton1 - click this and it opens Form
2
Form 1 has textbox(tbxOcCat) and a combobox (cbxOcCat) (among many
other things)

Form 2 (ufOcCat) has a list box (lbxOcCat) with 2 columns!!!
This contains a 2 column range from a worksheet(OcCat!).

The user selects (double clicks) the relevent row in lbxOcCat....
and this is the part Im having difficulty with....

The info in ufOcCat column1 should go to ufCombIns, tbxOcCat
and ufOcCat column2 goes to ufCombIns, cbxOcCat
and ufOcCat is closed.

This is what I have so far......
(Some of this relates to the search function for lbxOcCat - just ignore
cause that bit works...)

Private Sub cmdLookUp_Click()
Unload Me
End Sub

Private Sub TextBox1_Change()

Dim s As String
Dim i As Integer
s = TextBox1.Text

lbxOcCat.ListIndex = -1
If TextBox1.Text = "" Then
Exit Sub
End If
For i = 0 To lbxOcCat.ListCount - 1
If UCase(lbxOcCat.List(i)) Like UCase(s & "*") Then
lbxOcCat.ListIndex = i
Exit Sub
End If
Next

End Sub

Private Sub UserForm_Initialize()
lbxOcCat.RowSource = "OcCat!A2:B895"

End Sub

Private Sub lbxOcCat_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If lbxOcCat.ListIndex = -1 Then
Exit Sub
End If
Selection.Cells(1) = 'ufCombIns.tbxOcCat
Selection.Cells(1).Offset(0, 1) = 'ufCombIns.cbxOcCat
Unload Me
End Sub