Hi All.
I am working with a form to lookup records in one of my tables. The table has 3 primary keys and is not pulling up the records correctly.
Form1 is bound to Table1 (a list of Customers and CustomerID's) ComboBox1 looks up the Customer.
SubForm2 is bound to Table2 (list of Products by CustomerID) ListBox2 gives a list of products per customer.
The problem is when there 2 of the same ProductID's per customer then the subform will only show the record information of one of the Products no matter which one I choose.
Table2 has 3 Primary keys: CustomerID, ProductID, & ShipPoint. So the problem is when I am choosing between two products that have the same CustomerID & ProductID.
I have the form requery on current and after update. The recordset is
I tried
but it didn't do anything.
Any help would be great.
I am working with a form to lookup records in one of my tables. The table has 3 primary keys and is not pulling up the records correctly.
Form1 is bound to Table1 (a list of Customers and CustomerID's) ComboBox1 looks up the Customer.
Code:
SELECT tblCustomers.CorpID, tblCustomers.Customer FROM tblCustomers ORDER BY tblCustomers.Customer;
Code:
SELECT tblCustReq.Product_ID, tblCustReq.CORP_ID, tblCustReq.ShipToID FROM tblCustReq WHERE Forms!ProductReq2!Customer=tblCustReq.CORP_ID ORDER BY tblCustReq.Product_ID;
Table2 has 3 Primary keys: CustomerID, ProductID, & ShipPoint. So the problem is when I am choosing between two products that have the same CustomerID & ProductID.
I have the form requery on current and after update. The recordset is
Code:
Private Sub ProductList_AfterUpdate()
' Find the record that matches the control.
Dim ts As Object
Set ts = Me.Recordset.Clone
ts.FindFirst "[Product_ID] = '" & Me![ProductList] & "'"
If Not ts.EOF Then Me.Bookmark = ts.Bookmark
'Me.Requery
End Sub
Code:
Private Sub ProductList_AfterUpdate()
' Find the record that matches the control.
Dim ts As Object
Set ts = Me.Recordset.Clone
ts.FindFirst "[Product_ID] = '" & Me![ProductList] & "'"
ts.FindNext "[ShipToID] = '" & Me![ShipToID] & "'"
If Not ts.EOF Then Me.Bookmark = ts.Bookmark
'Me.Requery
End Sub
Any help would be great.
Comment