April15Hater
Accountant
- Local time
- Today, 12:36
- Joined
- Sep 12, 2008
- Messages
- 349
Hi-
I have 2 listboxes:
lstUnassigned
.rowsource:
dblClick Procedure:
lstAssigned
.rowsource:
What I'm trying to do is get it so that when I double click unassigned, it moves it over to assigned (which currently works), but I also need it to not show in unassigned. I would like to use a WHERE NOT IN clause in lstUnassigned.Rowsource, but I can't figure ou how to refer to another objects rowsource in SQL.
Any help is appreciated.
Joe
I have 2 listboxes:
lstUnassigned
.rowsource:
Code:
SELECT tblProductionTracking.ProductionTrackingID, tblProductionTracking.ProductionID, tblProductionTracking.FunctionTrackingID, tblProductionTracking.TrackingNumber
FROM tblProductionInput INNER JOIN tblProductionTracking ON tblProductionInput.ProductionID = tblProductionTracking.ProductionID
WHERE (((tblProductionTracking.FunctionTrackingID)=[Forms]![frmProductionStep3b]![cboTrackableSel]));
dblClick Procedure:
Code:
Private Sub lstUnassigned_DblClick(Cancel As Integer)
Dim rsListBox As ADODB.Recordset
Set rsListBox = New ADODB.Recordset
With rsListBox
.ActiveConnection = CurrentProject.Connection
.Source = "SELECT * FROM tblProductionStep3blstAssigned"
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open
.AddNew
!ProductionID = Me.txtProductionID.Value
!ProductionTrackingID = Me.lstUnassigned.Column(0)
!FunctionTrackingID = Me.cboTrackableSel.Value
!TrackingNumber = Me.lstUnassigned.Column(3)
.Update
.Close
End With
Me.lstAssigned.Requery
End Sub
lstAssigned
.rowsource:
Code:
SELECT tblProductionStep3blstAssigned.ProductionTrackingID, tblProductionStep3blstAssigned.FunctionTrackingID, tblProductionStep3blstAssigned.TrackingNumber
FROM tblProductionStep3blstAssigned
WHERE (((tblProductionStep3blstAssigned.FunctionTrackingID)=[forms]![frmProductionStep3b]![cboTrackableSel]));
What I'm trying to do is get it so that when I double click unassigned, it moves it over to assigned (which currently works), but I also need it to not show in unassigned. I would like to use a WHERE NOT IN clause in lstUnassigned.Rowsource, but I can't figure ou how to refer to another objects rowsource in SQL.
Any help is appreciated.
Joe