scubadiver007
Registered User.
- Local time
- Today, 08:21
- Joined
- Nov 30, 2010
- Messages
- 317
For a combo box I am using "allocations_appraiserlist_MR" as the default source:
I need to check if this has returned zero records and I then need to use a separate source for each of the following conditions:
1) If no record is returned in the combo and a text box states "non-locum" I need to use the source "allocations_appraiserlist_SR":
2) If no record is returned in the combo and a text box states "locum" then I need to use the source "allocations_appraiserlist_All":
Would I have to use VBA?
Code:
SELECT DISTINCT temptable_dctrecs.AppraiserGMC, [FName] & " " & [Surname] AS AppraiserName
FROM Tble_Appraiser INNER JOIN temptable_dctrecs ON Tble_Appraiser.GMC_ID = temptable_dctrecs.AppraiserGMC
WHERE (((temptable_dctrecs.DoctorGMC)=[forms]![Form_Appraisals]![GMC_ID]));
I need to check if this has returned zero records and I then need to use a separate source for each of the following conditions:
1) If no record is returned in the combo and a text box states "non-locum" I need to use the source "allocations_appraiserlist_SR":
Code:
SELECT tble_validpractices.GMC_ID, [tble_appraiser]![FName] & " " & [tble_appraiser]![Surname] AS AppraisalName, Tble_DoctorAppraisal.GMC_ID
FROM (Tble_DoctorAppraisal INNER JOIN Query1 ON Tble_DoctorAppraisal.GMC_ID = Query1.GMC_ID) INNER JOIN (Tble_Appraiser INNER JOIN (tble_validpractices INNER JOIN Tble_DocPrac ON tble_validpractices.KCode = Tble_DocPrac.KCode_ID) ON Tble_Appraiser.GMC_ID = tble_validpractices.GMC_ID) ON Tble_DoctorAppraisal.GMC_ID = Tble_DocPrac.GMC_ID
WHERE (((Tble_DoctorAppraisal.GMC_ID)=[forms]![Form_Appraisals]![GMC_ID]));
2) If no record is returned in the combo and a text box states "locum" then I need to use the source "allocations_appraiserlist_All":
Code:
SELECT Tble_Appraiser.GMC_ID, [FName] & " " & [Surname] AS AppraiserName
FROM Tble_Appraiser;
Would I have to use VBA?