473,385 Members | 1,311 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,385 software developers and data experts.

How to filter/remove combo box values if previously used/entered

6
Hi,

I'm new to the forum so please excuse my lack of knowledge.

I have a combo box containing a training date (combo box is sourced from tblTrainingCourse). I'd like to filter this combo box if a particular training date is entered into a form a pre-defined number of times (A training course only has a limited number of places so once a particular number of individuals have been assigned to this course, it should be removed from the combo box).

Structure:
tblIndividual
IND ID
Name
etc...

tblTraining Course
TC ID
Course name
no. of course places

tbl Attendance
ATT ID
IND ID
TC ID

Relationships:
tblIndividual 1.....* tblAttendance *.....1 Training Course

Hope this makes sense!
Oct 11 '08 #1
8 2783
ADezii
8,834 Expert 8TB
  1. To what Table/Query is your Form Bound?
  2. What Table does the Training Date Field reside in, I don't see it in your structure?
Oct 11 '08 #2
nezzy
6
  1. To what Table/Query is your Form Bound?
  2. What Table does the Training Date Field reside in, I don't see it in your structure?
Sorry. Form is bound to tblAttendance. Training Date field resides in tbl Course Dates.

Structure:
tblIndividual
IND ID
Name
etc...

tblTraining Course
TC ID
Course name
no. of course places

tblCourse Dates
CD ID
TC ID
Date

tbl Attendance
ATT ID
IND ID
CD ID

Relationships:
tblIndividual 1....* tblAttendance *....1tblCourseDates*...1 tblTrainingCourse
Oct 12 '08 #3
ADezii
8,834 Expert 8TB
  1. Assuming the following Relationship:
    Expand|Select|Wrap|Line Numbers
    1. tblTrainingCourse.[TC ID](1) ==>  tblCourseDates.[TC ID](MANY)
  2. Assuming a [Training Date] Field exists in tblTrainingCourse
  3. The Row Source of your Combo Box is derived from the Dates in the [Training Date] Field in tblTrainingCourse
  4. You wish to display only Dates in your Combo Box which occur less than 6 times in tblCourseDates
  5. This SQL Statement should do the trick.
    Expand|Select|Wrap|Line Numbers
    1. SELECT tblTrainingCourse.[Training Date]
    2. FROM tblTrainingCourse INNER JOIN tblCourseDates ON tblTrainingCourse.[TC ID] = tblCourseDates.[TC ID]
    3. GROUP BY tblTrainingCourse.[Training Date]
    4. HAVING Count(tblCourseDates.[Training Date])<6
    5. ORDER BY tblTrainingCourse.[Training Date];
  6. P.S. - You must Requery the Combo Box after each Record addition in the Form.
  7. Any questions, feel free to ask.
Oct 12 '08 #4
nezzy
6
The Training Date actually resides in tblCourse Date but I understand the principle.

I've tried something similar already but have found that once an entry is removed from the combo box, any previous entries of that date dissapear from the form aswell (any entries go blank).
Oct 12 '08 #5
ADezii
8,834 Expert 8TB
The Training Date actually resides in tblCourse Date but I understand the principle.

I've tried something similar already but have found that once an entry is removed from the combo box, any previous entries of that date dissapear from the form aswell (any entries go blank).
I'm assuming the Combo Box is 'Unbound' and used only for selecting an available Training Date, is this correct? Given the above statment, removing a Date from the Row Source of the Combo should have no effect whatsoever on existing values.
Oct 12 '08 #6
nezzy
6
I'm assuming the Combo Box is 'Unbound' and used only for selecting an available Training Date, is this correct? Given the above statment, removing a Date from the Row Source of the Combo should have no effect whatsoever on existing values.
Thanks. How do I un-bind the combo box?
Oct 12 '08 #7
nezzy
6
....................
Oct 12 '08 #8
nezzy
6
Found a workaround. Thanks for your help!
Oct 12 '08 #9

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

Similar topics

3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
8
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and...
0
by: D Perron | last post by:
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 and the other . I have a form called...
7
by: Keith | last post by:
A2003, XP Pro SP2. I'm developing a simple custom filter form for a client and keep running into the same error. I've posted a simplified version in my web space at ...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
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...
6
by: bammo | last post by:
MS Access 2003, Windows XP SP2, VBA I have a continuous form that allows edits and filters, but not deletions or additions. I filter the form based on combining selections the user makes in...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.