Search Criteria: Two combo boxes: Issue with second combo

L

Lance

Hello,

I have created a form, called "frmProgram", which loads based on some
criteria in a search prior to the form (There is a form, called
frmLook, which filters out the recordsource based on semester and
year). Thus, when I get to "frmProgram", I have a recordset of about 10
records, all organizations participating in this program, during the
semester.

At this point, the user still needs to filter out by Organization name
(cmbSearch1), and Project Name (cmbSearch2) [Project name is required
as a search criteria because in some semesters, the same organization
will have multiple projects]. However, most organizations will not have
multiple projects. Yet, whenever I am loading the form, it requires the
user to set BOTH combo boxes before displaying the record [obviously
since if cmbSearch2 is empty, it will return zero results]. I am
looking for a way to have cmbSearch2 look at the specific recordset
data available [say cmbSearch1 returns OrgID=1], and then select the
first available record in cmbSearch2.

I was going to have it always just pick the first record, 1 [the keyID
for the second search string is just 1,2,3, etc depending on the # of
projects hte organization has], but the problem is that if someone adds
two projects from a company, and then decides to delete the first one,
I will get errors if the default value of cmbSearch2 = 1.

Anyway, i hope that's enough description, any help would be
appreciated.

Thanks!
 
Top