Hello to all,
I have a form that contains 3 combo boxes. I need the value of the combo boxes be passed to a query that another form is based off of.
1st field passes a -1 or 0 to the query for a yes/no field
2nd field passes text for the country selected
3rd field is bases off a joined table in the query and will see if any ID exists or not... so I need it to check for null or not null.
I don't know how either thru VBA or the query to tell it that I want null records or not. I can't pass "Is Null" from a field on the form thru the criteria in the query.
For exaple:
OrphanStatus: SponsoredStatus Country
(Value to pass) (Value to pass) (Value to pass)
from the Active? field from the sponsoring.sponsorship_id field from the country field
--------------------------------------------------------
-1 is not null sierra leone
**Should return 1 record
-1 is null sierra leone
**Should return 72 records
Here is the sql that I have now:
Please help me with this...
I have a form that contains 3 combo boxes. I need the value of the combo boxes be passed to a query that another form is based off of.
1st field passes a -1 or 0 to the query for a yes/no field
2nd field passes text for the country selected
3rd field is bases off a joined table in the query and will see if any ID exists or not... so I need it to check for null or not null.
I don't know how either thru VBA or the query to tell it that I want null records or not. I can't pass "Is Null" from a field on the form thru the criteria in the query.
For exaple:
OrphanStatus: SponsoredStatus Country
(Value to pass) (Value to pass) (Value to pass)
from the Active? field from the sponsoring.sponsorship_id field from the country field
--------------------------------------------------------
-1 is not null sierra leone
**Should return 1 record
-1 is null sierra leone
**Should return 72 records
Here is the sql that I have now:
Code:
SELECT orphans.[Active?], sponsoring.[Sponsorship ID], orphans.Country, orphans.[Orphan ID], orphans.Name, orphans.Sex, orphans.Age, orphans.[Date of Birth], orphans.Location, orphans.Photo, orphans.[Date Added], orphans.[Date Updated], sponsoring.[Sponsor ID], sponsoring.[Term of Sponsorship], sponsoring.[Start of Sponsorship], sponsoring.[End fo Sponsorship], sponsoring.[Payment Type], sponsoring.[Payment Schedule], sponsoring.[Total Number of Payments Due], sponsoring.[Number of Payments Made], sponsoring.[Total Amount Due], sponsoring.[Total Amount Paid], sponsoring.[Total Overdue Payments], sponsoring.[Record Active?], sponsoring.[Date Last Updated]
FROM orphans LEFT JOIN sponsoring ON orphans.[Orphan ID] = sponsoring.[Orphan ID]
WHERE (((orphans.[Active?])=[forms]![frm_ViewOrphans]![txtOrphanStatus]) AND ((orphans.Country)=[forms]![frm_ViewOrphans]![txtCountry]));
Please help me with this...