List Box Query

DomZ

Registered User.
Local time
Yesterday, 20:15
Joined
Jun 16, 2003
Messages
31
I have a query that populates some information.
I need to narrow the information. I have a list box where there's some info in it and I want the CustomerID, which is column 0 in the list, to be the CustomerID that the user selects from the Listbox
So what would be the part in bold?
WHERE (((TblPartsTracking.CustomerID)=[Forms]![FrmPartsTracking]![????lstParts.Column???])

Thanks

EDIT:
Also, I would like to do the following:
If in TblParts, the Finish.Value = ABC for that part, use TblProcABC as record source for the subform in my report.. how would that be possible?
 
Last edited:
Dom:

If you have set the Bound Column of the Listbox to the CustomerID, then all you need is:

WHERE (((TblPartsTracking.CustomerID)=[Forms]![FrmPartsTracking]![NameofListbox])

Let me know if that helps
 
No my list box is unbounded since my list box gets some information from all sort of lookups
 
K but just to advise you:
i want the CustomerID to be taken from the choice that is selected from the list box
currently displaying 3 columns in my list box
 
Paul I have a question...
From this query,

SELECT TblPartsTracking.PartNumber, TblPartsTracking.CustomerID, TblPartsTracking.DateIn, TblParts.Process
FROM TblParts INNER JOIN TblPartsTracking ON TblParts.PartNumber = TblPartsTracking.PartNumber
WHERE (((TblPartsTracking.CustomerID)=[Forms]![FrmPS]![cboCustomerID]) AND ((TblPartsTracking.DateIn) Between [Forms]![FrmPS]![txtFmDate] And [Forms]![FrmPS]![txtToDate]) AND ((TblPartsTracking.Out)=False));

What this does, is that the user enters 2 dates in 2 text boxes, then selects a company and then it filters the parts from that company within 2 dates.. now what i want to do is(am I using the right query?) when the user clicks on that part, it autolookup the Process from that part and puts it in txtProcess text box..
My afterevent for my combo box is:
Private Sub cboPartNumber_AfterUpdate()
Me.txtProcess = Me.cboPartNumber.Column(4)
End Sub

However, it doesn't autolookup how come?
 
LOL sorry pat, i have a headacke and I was thinking about a paul when i wrote the msg

Thanks got it working
 

Users who are viewing this thread

Back
Top Bottom