Currently I'm working to generate report using Microsoft Access. I'm having problem where I need to make some controls visible to false as where if there is condition A then only certain control visible will be true, if condition = B, different control visible will be true.
Below is the code I worked on:-
strqry = "SELECT * FROM tbl_task_entry_dublin INNER JOIN tbl_resource ON
tbl_task_entry_dublin.user_id=tbl_resource.user_id"
Set rst = CurrentDb.OpenRecordset(strqry)
With rst
.MoveLast
rst_total_count = .RecordCount
.MoveFirst
For i = 0 To rst_total_count - 1
If Nz(!activity_name) = "Test Execution" Then
Me.txt_script.Visible = False
Else
Me.txt_script.Visible = True
End If
.MoveNext
Next i
Me.RecordSource = strqry
End With
The problem that I having with this code, it only take the last record count. For example, there is 9 condition, it only shows control that meet the condition for record 9. So all the record will display same control.