Can a combo box be set to display only certain data - TechRepublic
Question
September 12, 2007 at 07:48 PM
imroseofsharon

Can a combo box be set to display only certain data

by imroseofsharon . Updated 18 years, 10 months ago

I have a combo box that selects a customer and brings up all of the data associated with that customer (Billing data (on Main form), Order data (on Sub form #1) and Shipping Data on Sub form #2)…

The combo box is unbound and uses a select table/query.
Both subforms are ‘bridged together’ with the main form, so when you select a customer name all 3 forms populate…

Main form – based on Customer table
Sub form 1 – based on Order Detail table
Sub form 2 – based on Order table

It’s the data from Sub form 1 and 2 that I don’t want ‘old’ information to appear. I do need these forms ‘bridged’ so when I enter NEW info into sub 1 and sub 2, it will be stored in the appropriate tables.

Here’s the code for the combo box:

Code: ( text )
SELECT DISTINCTROW Customers.CustomerID, [FirstName] & ” ” & [LastName] FROM Customers ORDER BY [FirstName] & “,” & [LastName];

There’s also an ‘After Update’ event associated with ‘custname’:

Code: ( text )
Private Sub custname_AfterUpdate()
Me.FilterOn = True
Me.Filter = “CustomerID = ” & Me.custname
Me.Requery
End Sub()

Thanks for any help you can provide..

This discussion is locked

All Comments