473,395 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can a combo box be restricted to display certain data

imrosie
222 100+
Hello All,

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:
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCTROW Customers.CustomerID, [FirstName] & " " & [LastName] FROM Customers ORDER BY [FirstName] & "," & [LastName]; 

There's also an 'After Update' event associated with 'custname':
Expand|Select|Wrap|Line Numbers
  1. Private Sub custname_AfterUpdate()
  2. Me.FilterOn = True
  3. Me.Filter = "CustomerID = " & Me.custname
  4. Me.Requery
  5. End Sub()
Thanks for any help you can provide..
Rosie
Sep 13 '07 #1
1 1515
Scott Price
1,384 Expert 1GB
Hi Rosie,

How are you going to differentiate between old and new data? Is there a date field that you can filter by?

Your combo box can be filled with a SELECT query (just like you have) but all that you need to add is a WHERE [tableX].[OrderDate] = [SomeDate]

Regards,
Scott
Sep 19 '07 #2

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

Similar topics

10
by: Bob Darlington | last post by:
I am using the following SQL as a RowSource for a combo box on a form. "SELECT LAN, TenantName as , ShopNum as FROM qTenantSelect " The field 'ShopNum' is a text field and has a caption...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
18
by: Vayse | last post by:
Has anyone an example of filling a combo box with a data reader? Thanks Vayse
5
by: Kevin | last post by:
So moving on in my project, I've replaced all of my "Lookup" fields with regular field types. Now I'm designing my combo boxes. I've used the combobox wizard to create a few, and have set the...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
10
by: thh108688 | last post by:
Hi all, I have got a question here perhaps someone can provide me some good information or suggestion. In the Access Form I have created 2 combo box one is Activity combo box, the other is...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.