Hey guys,
This is my first time posting in this particular section of the forums. I'm trying to work within an access database that has three text boxes and a listbox. The three textboxes contain dates. The contents of the listbox should be generated from the following query:
You can probably see what's going on in the code above. I'm working with three different conditions, each of which has two conditions.
Date One - The first condition is that Date One must be between 0 and today (which is checkdate2 variable). The second condition is that Date Two must be blank.
Date two goes along the same lines. The first condition is that Date Two must be between 0 and today (which is checkdate2 variable). The second condition is that Date Three must be blank.
Date Three is basically the same, but doesn't need the second condition as there is no Date 4 afterwards. The first condition is that Date Three must be between 0 and today (which is checkdate2 variable).
THE MAIN IDEA: The database handles students graduation dates. The students can take up to three classes in succession, each of which has a graduation date. The listbox needs to be populated with students that have graduated from their final course. The issue is that right now, with the code that i'm using that works, the list also populates with students that have another class coming up.
Anyways, I'm sure it's a simple fix, and I'd greatly appreciate any help anyone can toss in my direction. Thanks.
This is my first time posting in this particular section of the forums. I'm trying to work within an access database that has three text boxes and a listbox. The three textboxes contain dates. The contents of the listbox should be generated from the following query:
Code:
strSQL2 = "
SELECT Students_Info.firstname, Students_Info.lastname, Students_Info.cell
FROM Students_Info
WHERE ((Students_Info.gradONE BETWEEN 0 AND #" & checkdate2 & "#) and Students_Info.gradTWO='') OR
((Students_Info.gradTWO BETWEEN 0 AND #" & checkdate2 & "#) and Students_Info.gradTHR='')
OR (Students_Info.gradTHR BETWEEN 0 and #" & checkdate2 & "#);"
You can probably see what's going on in the code above. I'm working with three different conditions, each of which has two conditions.
Date One - The first condition is that Date One must be between 0 and today (which is checkdate2 variable). The second condition is that Date Two must be blank.
Date two goes along the same lines. The first condition is that Date Two must be between 0 and today (which is checkdate2 variable). The second condition is that Date Three must be blank.
Date Three is basically the same, but doesn't need the second condition as there is no Date 4 afterwards. The first condition is that Date Three must be between 0 and today (which is checkdate2 variable).
THE MAIN IDEA: The database handles students graduation dates. The students can take up to three classes in succession, each of which has a graduation date. The listbox needs to be populated with students that have graduated from their final course. The issue is that right now, with the code that i'm using that works, the list also populates with students that have another class coming up.
Anyways, I'm sure it's a simple fix, and I'd greatly appreciate any help anyone can toss in my direction. Thanks.