Access 2007 Looping through control fields
Posted on 2012-09-04
I have 19 fields that contain text "Meets Criteria" or does "Criteria Not Met", each field is based off an if statement determines meets or not met.
My problem is that writing out an if statement below with 19 fields too long.
Here is the code that I'm using now.
If Me.[txtElig-FullTimeStudent].value = "Criteria Not Met" Or Me.[txtElig-Gender].value = "Criteria Not Met" Then
MsgBox "Client is not eligibility to be assigned to program"
'Clear the select PSH provider fields
.txtSelectedPSH.value = Null
.txtPSHAvailableUnits.value = Null
.txtdatDateofMoveOut.value = Null
.txtdatDateofAvailablity.value = Null
.txtAssignedDate.value = Null
.txtAvailablityDays = Null
I was wondering if its possible to loop through 19 fields and if the criteria is ""Criteria Not Met" then stop the code from proceeding