Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT
Private Sub Report_Open(Cancel As Integer) Dim rst As DAO.Recordset Dim iCount As Integer Dim fld As Field On Error GoTo Err_ErrorTag iCount = 1 Set rst = CurrentDb.OpenRecordset("qryTimesheet_GroupByEmployee_ThenActivity") For Each fld In rst.Fields '// These are the Rows. We want to start with the Column Headers. If fld.Name <> "Employee" And fld.Name <> "Employee_EmpID" And fld.Name <> "TotalOfTimeTotal" Then Me.Controls("txt" & iCount).ControlSource = "=([" & fld.Name & "]/[TotalOfTimeTotal])*100" Me.Controls("lbl" & iCount).Caption = fld.Name iCount = iCount + 1 '// This was added because only 30 controls fit on the report. However there are more columns being left out. If iCount > 30 Then Exit For '// Exit For Next End If End If Next '// This hides the controls if there are less then 30. Do Until iCount > 30 Me.Controls("txt" & iCount).Visible = False Me.Controls("lbl" & iCount).Visible = False Me.Controls("lbl" * iCount & "a").Visible = False Me.Controls("line" & iCount).Visible = False iCount = iCount + 1 Loop Exit_ErrorTag: On Error Resume Next Exit Sub Err_ErrorTag: MsgBox Err.Description & vbCrLf & vbCrLf & " Error #: " & Err.Number & vbCrLf & "Error Line: " & Erl & vbCrLf & "Procedure: Report_Open " & vbCrLf & " Location: Report_rptTimesheet_EmployeeActivity_EmployeTotals", vbExclamation, "Error" Resume Exit_ErrorTag End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.