Hello,
I am working on a database project that will have an output to a report composed of a series of Check Boxes to indicate completed tasks. A task is considered complete when a given date falls with in a two year window. (Between Date() and (Date () + 730)). I am able to get the query to determine the date criteria, now what is the best way to have the check box property, "Value", change from "No" to "yes"?
I assume the best way to handle this is to macro a "create table" query to generate the date data, send it to a form then generate a report from the form. I have tried this using the "On Load" procedure for the form to run some basic VBA in the background. The code follows:
Private Sub Form_Load()
Me.InitalAssessment.Value = "No"
Me.VitalSigns.Value = "No"
If Me.chkCPR = 1 Then
Me.InitalAssessment.Value = "Yes"
End If
If Me.chkACLS = 1 Then
Me.InitalAssessment.Value = "Yes"
End If
If Me.chkEMT = 1 Then
Me.InitalAssessment.Value = "Yes"
Me.VitalSigns.Value = "Yes"
End If
End Sub
If the date give in the database meets the 2 year criteria, the query assigns a value of "1" to the chkEMT, chkACLS or chkCPR field of the table. Now with an If..Then statement, the value in the chkEMT,chkACLS or chkCPR is evaluated and the .Value of a variety of objects is changed to "Yes". Is there a better way, and is there a way to cut the code down? There are 8 dates and about 30 tasks to compare!
Thanks in advance,
Mark
I am working on a database project that will have an output to a report composed of a series of Check Boxes to indicate completed tasks. A task is considered complete when a given date falls with in a two year window. (Between Date() and (Date () + 730)). I am able to get the query to determine the date criteria, now what is the best way to have the check box property, "Value", change from "No" to "yes"?
I assume the best way to handle this is to macro a "create table" query to generate the date data, send it to a form then generate a report from the form. I have tried this using the "On Load" procedure for the form to run some basic VBA in the background. The code follows:
Private Sub Form_Load()
Me.InitalAssessment.Value = "No"
Me.VitalSigns.Value = "No"
If Me.chkCPR = 1 Then
Me.InitalAssessment.Value = "Yes"
End If
If Me.chkACLS = 1 Then
Me.InitalAssessment.Value = "Yes"
End If
If Me.chkEMT = 1 Then
Me.InitalAssessment.Value = "Yes"
Me.VitalSigns.Value = "Yes"
End If
End Sub
If the date give in the database meets the 2 year criteria, the query assigns a value of "1" to the chkEMT, chkACLS or chkCPR field of the table. Now with an If..Then statement, the value in the chkEMT,chkACLS or chkCPR is evaluated and the .Value of a variety of objects is changed to "Yes". Is there a better way, and is there a way to cut the code down? There are 8 dates and about 30 tasks to compare!
Thanks in advance,
Mark