473,563 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filtering a ListBox based on two tables.

2 New Member
Hi All,

I'm getting used to using access so go easy on me.

The issue I'm having is getting my list box to provide the correct data. Based on two tables information.

I have two tables one called CustomerT and one called CustomerOrderT they both have a field called CRM ID, this is a one to many relationship. I have a CustomerF form that displays all of the data from the CustomerT table based on the CRM ID, I would also like it to display the last orders from CustomerOrderT based on the CRM ID. The ListBox currently shows all orders regardless of the CustomerF CRM ID displayed.

I hope this is enough of an explanation but please ask me for more info if needed.

Thanks.
Jul 6 '17 #1
4 1725
PhilOfWalton
1,430 Recognized Expert Top Contributor
Information is fine.

What is the RowSource of your listbox?

I would add that the more usual way of handling a Customer & Order situation is to use a subform to show all the orders.

If you look at the Northwind database Order Details Form, you will get the idea

Phil
Jul 6 '17 #2
TurnItOffAndOn
2 New Member
The Row Source is SelectCustomerO rdersT.

The actual table is a tracker as appose to filling in the full order. So each record is updated at a different stage, which is why I'm using a table to store the info. I'm displaying 3 fields from that table in my ListBox.
Jul 6 '17 #3
PhilOfWalton
1,430 Recognized Expert Top Contributor
Sorry, that is not a valid Rowsource. Please check it carefully

It should be more like
Expand|Select|Wrap|Line Numbers
  1. SELECT CustomerOrderT.* FROM CustomerOrderT
  2. WHERE [CRM ID] = Forms![YourFormName]![CRM ID]
  3. ORDER BY CustomerOrderDate DESC;
  4.  
You'll obviously will have to use the correct name of ypour form and the order date

Phil
Jul 6 '17 #4
NeoPa
32,564 Recognized Expert Moderator MVP
I'm guessing that [SelectCustomerO rdersT] is actually the name of a QueryDef.

Perhaps you could post in the SQL used for [SelectCustomerO rdersT] so that we can review it.
Jul 6 '17 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2755
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to write such layers myself I got stuck on how to get filtered or sorted data from the data-layer. This is what I got: Objects
0
1225
by: dentyne | last post by:
Good morning, I have a typed dataset with 10 relational, hierarchical tables. I want to be able to "filter" all the dataset tables based on one parent record. For instance, let's say I have a dataset that with 10 tables that contain information about all of the 40 some odd U.S. presidents. The main parent table would be the "President"...
0
1270
by: spowel4 | last post by:
VB 2005: Using an xml file as the data source, I need to fill a listbox with data based upon what was selected in a combobox. In other words, my data consists of a list of customers in a combobox; once a particular customer is selected I need to populate a listbox with data specific to the selected customer. A sample layout of the xml...
6
3367
by: BerkshireGuy | last post by:
On an unbound form, I have a combobox called 'cboproducttype' and a text box called 'txtamountappliedfor'. I have an Add button that I would like the user to be able to hit once a product and amount applied for has been entered. This should populate an unbound listbox to display their selections. A user can select one or more sets of...
5
3857
by: datasec23 | last post by:
Hi...I am trying to get my listbox data to change based on a field on a form. Each time I click on the next record indicator at the bottom of the form, I would like the Listbox to change information. The control field is "Patient ID" and the listbox is "Patient Medications". When I go to the next Patient ID record I would like the Listbox to...
3
2000
by: RamiH | last post by:
Hi, I am using a listbox to show data from a certain table, i want the user, after the listbox is filled, to be able to sort the data according to the column of his choice. I could sort the table and refresh the form, or directly sort the listbox. How can i do any of that without having to open the table? I also tried to use a subform that...
7
2212
stonward
by: stonward | last post by:
Hi Guys, I feel this should be straightforward, but I'm struggling. I have a listbox that displays the results of a filter/query - including the PK. I need to show just those same filtered results in another listbox, where I can display the data in a different format- that is it is displayed with spaces etc between the concatenated values....
2
13050
by: pwag | last post by:
Good Afternoon, I'm trying to auto-select items in a multi-select listbox based on a column's criteria in a VBA Sub. Here is my code thusfar that fails. All values are text data type. Any suggestions? Thanks. Dim lngRow As Long Dim lbvalue As String With Me.ListBox
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.