I have a form with 2 list box on them, when I click on a name in list box 1 I write that infor to a tmp file and I want the name to show up in the 2 list box.
I set the rowsource of the 2 list box to be the tmp file.
The info is being written to the tmp file but it will not show up in the 2 list box.
here is my code.
THANKS
I set the rowsource of the 2 list box to be the tmp file.
The info is being written to the tmp file but it will not show up in the 2 list box.
here is my code.
THANKS
Code:
Private Sub cmdswth_Click()
On Error GoTo Form_AfterUpdate_Err
Dim CurConn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set CurDB = CurrentDb
Set CurConn = New ADODB.Connection
'lstdest.Visible = False
With CurConn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "data source= " & CurDB.Name
.Open
End With
Set rst = New ADODB.Recordset
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Open "select * from tmp_usr", CurConn
With rst
.AddNew
![app_id] = Me.cboappname.Value
![empl_id] = Me.lstempall.Column(0)
![fname] = Me.lstempall.Column(1)
![lname] = Me.lstempall.Column(2)
![status] = 1
.Update
End With
bytcolcnt = 8
strcolwth = "0;" & "0;" & "0;" & "0;" & "0;" & "0;" & "1;" & "1"
strSrcTyp = "Table/Query"
'lstdest.Visible = True
strlstdest = "Select * from tmp_usr"
With lstdest
.ColumnCount = bytcolcnt
.ColumnWidths = strcolwth
.RowSource = strlstdest
.RowSourceType = strSrcTyp
End With
Call lstdest.Requery
rst.Close
Form_AfterUpdate_Exit:
Exit Sub
Form_AfterUpdate_Err:
MsgBox Err.Description
Resume Form_AfterUpdate_Exit
End Sub