See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.
Public Sub DeleteRenumber() Dim rs As DAO.Recordset Dim cbo As String Dim i As Integer Dim bLoop As Boolean Dim sPrefix As String Dim sSql As String On Error GoTo Err_cmdDelete_Click bLoop = True sPrefix = "XW-" & rs!TestType & "-" & rs!CTypeID & "-" & rs!BNo & "-" & rs!LNo & "-" & rs!STypeID & "-" 'Find next number from one about to be deleted i = Val(Mid$(Me.FDID, 2)) + 1 'Now update existing records Set rs = Me.RecordsetClone 'Find first next highest number sSql = "FDID = '" & sPrefix & Format(i, "00") & "'" Debug.Print "Looking for", sSql rs.FindFirst sSql Do While bLoop 'If no records found, end loop If rs.NoMatch = True Then bLoop = False Else 'Decrement number Debug.Print "Updating ID", rs!SID rs.Edit rs!FDID = sPrefix & Format(i - 1, "00") rs.Update 'Find next highest i = i + 1 sSql = "FDID = '" & sPrefix & Format(i, "00") & "'" Debug.Print "Finding next", sSql rs.FindNext "FDID = '" & sPrefix & Format(i, "00") & "'" End If Loop 'Closedown rs.Close Set rs = Nothing Me.Requery Exit_cmdDelete_Click: Exit Sub Err_cmdDelete_Click: MsgBox Err.Description Resume Exit_cmdDelete_Click End Sub
|how to get value from an object on another access form for global variable||2||25|
|unable to execute Update query in Access 2016 on a table linked to SQL.||5||32|
|Are There Any CSV File Field Column Mapper Tools For MS Access CSV File importing||12||27|
|How delete only new records in a continuous form||6||17|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
12 Experts available now in Live!