Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Private Sub Form_Load() 'Set error trap On Error Resume Next Dim strPath As String Dim db As Object Dim rst As DAO.Recordset Set rst = Me.RecordsetClone With rst If .RecordCount Then .MoveFirst Do Until .EOF 'When the last record is reached the code stops Me.Bookmark = .Bookmark ' Assign ID as path for images strPath = Me.ID 'Establish path for existing images and default path for missing immages Debug.Print "Error code: " & Err 'If Err <> 0 Then 'strPath = CurrentProject.Path & "\Resources\Images\ths.png" 'Else strPath = CurrentProject.Path & "\Resources\Images\Students\" & strPath & ".jpg" 'End If 'Load picture and name to form Me.Controls("Seat" & Me.Chair).Picture = UCase(strPath) Me.Controls("Student" & Me.Chair) = Me.Last & ", " & Me.First strPath = "" .MoveNext Loop End If End With rst.Close Set rst = Nothing 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.