473,756 Members | 4,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading Combo Box - Rest-

kcdoell
230 New Member
Hello:

I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CboDivision_AfterUpdate()
  2.  
  3. 'When the Division is selected, the appropriate Segment list will
  4. 'display in the drop down list of CboSegment
  5.  
  6.   With Me![cboSegment]
  7.      If IsNull(Me!cboDivision) Then
  8.         .RowSource = ""
  9.       Else
  10.         .RowSource = "SELECT DISTINCT tblSegment.SegmentID, " & _
  11.          "tblSegment.SegmentName " & _
  12.          "FROM TblLocationsMM INNER JOIN tblSegment " & _
  13.         "ON TblLocationsMM.SegmentIDFK = tblSegment.SegmentID " & _
  14.          "WHERE [DivisionIDFK]=" & Me!cboDivision
  15.  
  16.       End If
  17.      Call .Requery
  18.  
  19.     'Have the first dropdown list of cboSegment visible
  20.             If Me![cboSegment].ListCount > 0 Then
  21.                 Me![cboSegment] = Me![cboSegment].Column(0, 0)
  22.  
  23.     End If
  24.         End With
  25.  
  26. End Sub 
What I now trying to do is clear out any selections that have been made if the previous one has been changed...

The combo box names on the form are the following:

cboDivision
cboSegment
cboWrkReg
cboCreditReg
cboBrokerType

Can anyone help me with the code?

Thanks,

Keith.
Jun 16 '08 #1
2 2080
kcdoell
230 New Member
Hello:

Basically, what I am trying to do is make sure that the selections that they have selected is one of my Unique "LocationID s" in my tblLocationsMM. Right now they are able to move forward to the next form even though the LocationID does not exists.

What would be the best approach for preventing this scenario?

Thanks,

Keith.
Jun 16 '08 #2
kcdoell
230 New Member
Okay I solved this one, no need to reply....
Jun 16 '08 #3

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

Similar topics

0
2078
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding I've got a subform with a series of cascading combo boxes (thanks to the Access tutorials on fontstuff.com) that let the user assign categories to items, in this case photos. This is being done to help constrain user selections and keep the...
9
6761
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the second combo to change depending on what values the user selects in the first box, it's just that every time the user changes the first combobox, the second combobox FOR EVERY RECORD goes blank.
4
64630
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 determines the available options in the other. TERMINOLOGY Row Source: The table/query from which the Combo Box or List Box gets its values. Note: There are other types of row sources that can be used but for simplicity we will stick with Tables...
7
2545
kcdoell
by: kcdoell | last post by:
I have three tables: One for the Division location: tblDivision DivisionID = Autonumber DivisionName = Text One for the Working Region: tblWrkRegion
4
3495
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields below. tblOrg OrgID, AutoNumber, PK ZipID, Number, FK tblState StateID, AutoNumber, PK
3
3988
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment list will 'display in the drop down list of CboSegment With Me! If IsNull(Me!cboDivision) Then
7
5840
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm currently trying to set up a whole pile of cascading combo boxes of different levels of complexity, so I started with the easiest set - and can't even get that to work (even using the tutorial on this site at...
8
9303
by: 20028431 | last post by:
This is driving me mad! I have been trying for 3 days now to work out how to do this with no success. I have tables for Customer, Bookings, Entertainment, Act, Agent, and several others. I have created a form to view existing bookings with Customer details as mainform and Bookings and Entertainment as subforms and this works fine. I am trying to create forms to allow the booking clerk to enter a new Booking and am looking to have a...
0
9873
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9846
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3806
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
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.