473,666 Members | 2,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with combo boxes

I am having a problem working with one combo box that is filtering
another combo box.

My table is tblResearch. There are two field in this table; one
is[StudyCategory] and the other [Study]. I have a form called
frmResearch on which there are two combo boxes. The control source
for the first combo box [cbxCategory] is the field StudyCategory. The
control source for the 2nd combo box, [cbxStudy] is the field Study
and it's row source is a query called qrySelect. qrySelect selects
all studies where the category = cbxCategory from a table called
luStudies. When cbxCategory is updated, cbxStudy is requeried.

All works well unless the user decides that they want to delete what
they have entered into these boxes and leave it as blank. When they do
this (by highlighting the option in cbxCategory and pressing delete)
the update event requeries cbxStudy and it becomes blank as well.
This gives the user the impression that they have now deleted anything
that is in the underlying table. This is true for the StudyCategory
field, but the Study field retains whatever data they had previously
chosen.

How can I get the table get rid of the data in the field Study if the
user chooses to do the above?
Nov 13 '05 #1
1 1463
D Perron wrote:
I am having a problem working with one combo box that is filtering
another combo box.

My table is tblResearch. There are two field in this table; one
is[StudyCategory] and the other [Study]. I have a form called
frmResearch on which there are two combo boxes. The control source
for the first combo box [cbxCategory] is the field StudyCategory. The
control source for the 2nd combo box, [cbxStudy] is the field Study
and it's row source is a query called qrySelect. qrySelect selects
all studies where the category = cbxCategory from a table called
luStudies. When cbxCategory is updated, cbxStudy is requeried.

All works well unless the user decides that they want to delete what
they have entered into these boxes and leave it as blank. When they do
this (by highlighting the option in cbxCategory and pressing delete)
the update event requeries cbxStudy and it becomes blank as well.
This gives the user the impression that they have now deleted anything
that is in the underlying table. This is true for the StudyCategory
field, but the Study field retains whatever data they had previously
chosen.

How can I get the table get rid of the data in the field Study if the
user chooses to do the above?


In the AfterUpdate event of the primary combo you could enter something like
If IsNull(Me.Prima ryCombo) Then
Me.SecondaryCom bo = Null
ENdif
Me.SecondaryCom bo.Requery

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3522
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the form, I set the rowsources of its, and its subforms', combo boxes in the "Enter" events of the combo boxes. That's the standard trick for not loading the rowsource unless/until the user actually needs the combo box. For example:
0
1204
by: Aravind | last post by:
Hi folks. I am using Access 97. I have a form, frmHistory, which has 2 combo boxes (cboSelectTitle and cboSelectName) and 2 text boxes (Title and MemName). When the form is opened, it displays all the (dummy) history of books borrowed by members. Both the combo boxes uses macros, with the following actions. cboSelectTitle: OpenForm: Form Name: frmHistory
4
7175
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2) how to use the selection "All" as criteria for a field in a query, which is used to generate data for a report.
4
2342
by: John Tyce | last post by:
The problem that I am now having, involves refreshing controls. I have allot of text boxes, several combo boxes and grids. These controls are showing live data from an Oracle database. I have dates in a combo box in my tool bar that are associated with the particular report that the user is opening. When the user picks a different date all of the data in the controls should reload. I originally built an SDI application but needed my tool bar to...
3
1323
by: prakashsurya | last post by:
Hi i am having a small problem with combo boxes actually i am preparing a form in which i have to go through the experience in years for that i am using 4 combo boxes. on the first two combo boxes, i want to display the starting month and year of the employees experience and the remaining two combo boxes the ending month and year of the experience has to be displayed actually my prob is when ever i will select one option in the starting...
1
2905
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a main form (RD Form) with 4 combo boxes (i.e. cbo1, cbo2, etc) and a subdatasheet (the subform...let's call it subInfo) below the combo boxes on the RD Form. I hope this eliminates any confusion of the
2
3267
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once selecting from the combo box, I have all the combo boxes, using afterupdate, populating their respective list boxes. These text boxes are directly correlated to the combo box selection using SQL. Here is an example from the afterupdate event in the...
2
7044
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 database I wrote for home, the combo boxes and listboxes no longer display the bound column. For example, on a form I have a combo box based on a table called 'names'. The two columns in the combo box are ID and Surname. The combo box and list box...
3
1835
by: =?Utf-8?B?Y2RtdW5veg==?= | last post by:
I have created a sub routine to programmatically add an indefinite number of combo boxes to a form. The combo boxes are bound in code to a view for displaying the available options. This routine works good until you add the second combo box. At that point it changes the first combo box's selected item. A third changes the second and first and so on. I've tried setting the combo box name and tag to a unique name, but that doesn't help. ...
0
8454
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8785
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
8560
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
8644
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
7389
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
6200
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
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1778
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.