I have a form (frminitialincome) that tracks different income sources for clients in a social work outreach project through several check boxes (we are limited to tracking only certain kinds of income based on what our funders want to see) that populates a table with same (tblclientincome.) It is not a case where only one option can be listed for a client as any of them can have multiple sources of income (e.g. many have Food Stamps along with Cash Employment income.) However, there are some constant conditions that I wanted to set.
If a client is receiving SSI (basically disability payments for those with little to no work history) and/ or SSDI (disability for those with a bit of a work history) it is assumed (and should be assumed) that they will also receive state medical insurance (Medicaid.) I currently have the relevant check boxes doing this:
Private Sub ssicheck_Click()
If Me.ssicheck = True Then
Me.medicaidcheck = True
Else
Me.medicaidcheck =False
End If
End Sub
AND
Private Sub ssdicheck_Click()
If Me.ssdicheck = True Then
Me.medicaidcheck = True
Else
Me.medicaidcheck =False
End If
End Sub
It would be good if the Medicaid checkbox was only dependent on one field, but as you can tell from the codes, if a person were to click on ssi then were to want to change the answer to ssdi by clicking the ssdi field to true THEN ssi to false, the second action would set the Medicaid checkbox to false. I would like to think that the people entering the data would double check their entries or go through proper steps (i.e. clearing the incorrect checkbox before checking off the correct one), but then I wouldn't have my job.
Is there some kind of syntax that can make an "unless" statement in the code? Something like, "Else, me.checkbox = false UNLESS me.othercheckbox = true"
If a client is receiving SSI (basically disability payments for those with little to no work history) and/ or SSDI (disability for those with a bit of a work history) it is assumed (and should be assumed) that they will also receive state medical insurance (Medicaid.) I currently have the relevant check boxes doing this:
Private Sub ssicheck_Click()
If Me.ssicheck = True Then
Me.medicaidcheck = True
Else
Me.medicaidcheck =False
End If
End Sub
AND
Private Sub ssdicheck_Click()
If Me.ssdicheck = True Then
Me.medicaidcheck = True
Else
Me.medicaidcheck =False
End If
End Sub
It would be good if the Medicaid checkbox was only dependent on one field, but as you can tell from the codes, if a person were to click on ssi then were to want to change the answer to ssdi by clicking the ssdi field to true THEN ssi to false, the second action would set the Medicaid checkbox to false. I would like to think that the people entering the data would double check their entries or go through proper steps (i.e. clearing the incorrect checkbox before checking off the correct one), but then I wouldn't have my job.
Is there some kind of syntax that can make an "unless" statement in the code? Something like, "Else, me.checkbox = false UNLESS me.othercheckbox = true"
Last edited: