ComboBox Help

atrodden

Registered User.
Local time
Today, 20:44
Joined
Jan 23, 2014
Messages
15
Hello,

I have a database with a from for tracking training course sales and on that form there is a drop down box with all the training dates & Locations in which it gets from a table.

However as that list is getting longer and longer I have added ">Date()-31" to the criteria so everything older than a month is hidden from the list and cannot be selected which is all well and good.

But when we look at old bookings it we cant see which course date was selected because its hidden, is there anyway I can make it hide things older than a month but still show it if it has already been selected in the combobox?

Thanks
Adam
 
You need to be clear about when you want this difference in your combo box behaviour.

From your question I think you have a "Data Entry" mode and a "Viewing" mode.

Your combo box has a "Row Source" which you can change via VBA.

Set it to normally show all records, but change it to a restricted list when entering a new record.
 
Sorry for not being very clear let me try and explain how the database is set up.

We have a table with companies in it, and a table with training courses in it.
We have another table which list which companies have booked on which course. And the form mentioned above is used to select a company (from the companies table) and the course they wish to go on (from the course table).

When selecting a course from the combo box it only shows courses that are no older than 31 days, using the following row source..

Code:
SELECT tbl_ScheduledCourses.ID_SchedCourse, [tbl_Courses.CourseTitle] & " on " & [CourseDate] & " at " & [Venue] AS Expr1
FROM tbl_Courses INNER JOIN tbl_ScheduledCourses ON tbl_Courses.ID_Course = tbl_ScheduledCourses.ID_Course
WHERE (((tbl_ScheduledCourses.CourseDate)>Date()-31))
ORDER BY tbl_Courses.CourseTitle, tbl_ScheduledCourses.CourseDate;

Now if you want to view an old record in the form you can search for the company and it will show you there old bookings, however if they are more than 31 days old, the course they attended isn't visible in the combo box and I would like it to be.

Does this make more sense ? :)

Thank You
 
Is that the record source of the combo box?
 
You need to be clear about when you want this difference in your combo box behaviour.

>>>you can search for the company and it will show you there old bookings,<<<

So this is the point at which you want to change the combobox row source?
 

Users who are viewing this thread

Back
Top Bottom