No . Not fixed.
Please find the below code i modified which u sent early as per my requirement.
Function copyall()
Dim response, rs As Object, count As Integer, filecount As Integer, SQL As String, FSO As Object, filename As String
'Dim FSO As Object
Dim filenameraw As String
Dim FromPathraw As String
Dim ToPathraw As String
Dim filenamecta As String
Dim ToPathcta As String
Dim FromPathcta As String
Dim filenameinvoice As String
Dim FromPathinvoice As String
Dim ToPathinvoice As String
Set FSO = CreateObject("Scripting.FileSystemObject")
On Error GoTo errorcatch
response = MsgBox("Are You Sure You Want to Transfer " & Me.Combo0 & " Files", vbYesNo + vbExclamation + vbDefaultButton2)
If response = vbNo Then Exit Function ' User chose No.
SQL = "SELECT [V 6 issue 3].* " & _
"FROM [V 6 issue 3] " & _
"WHERE Status = '" & Me.Combo0 & "' "
Set rs = CurrentDb.OpenRecordset(SQL)
If rs.RecordCount <> 0 Then
rs.MoveLast
rs.MoveFirst
End If
filecount = rs.RecordCount
For count = 1 To filecount
If Not IsNull(rs![Ms no]) Then
'filename = "MS " & rs.[Ms no] & ".docx"
filenameraw = "MS " & rs.[Ms no] & "*" '<< Change
filenamecta = "MS " & rs.[Ms no] & "*" '<< Change
filenameinvoice = "Invoice * " & rs.[Ms no] & "*" '<< Change
MsgBox filenameraw
FromPathraw = "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Rawarticles\" '<< Change RAW
ToPathraw = "\\DELL-LPTP\BackupVolume\RAW\" '<< Change RAW
FromPathcta = "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\CTA form recieved from authors new version\" '<< Change CTA
ToPathcta = "\\DELL-LPTP\BackupVolume\CTA\" '<< Change CTA
FromPathinvoice = "\\Dell-lptp\d\IJPBS process\Vol - 5, Issue 1\Invoice sent to author\" '<< Change Invoice
ToPathinvoice = "\\DELL-LPTP\BackupVolume\Invoice\" '<< Change Invoice
'FileExt = "*" & a & " RAW*.*" '<< Change
If Right(FromPathraw, 1) <> "\" Then
FromPathraw = FromPathraw & "\"
End If
If Right(FromPathcta, 1) <> "\" Then
FromPathcta = FromPathcta & "\"
End If
If Right(FromPathinvoice, 1) <> "\" Then
FromPathinvoice = FromPathinvoice & "\"
End If
Set FSO = CreateObject("scripting.filesystemobject")
FSO.CopyFile Source:=FromPathraw & filenameraw, Destination:=ToPathraw
FSO.CopyFile Source:=FromPathcta & filenamecta, Destination:=ToPathcta
FSO.CopyFile Source:=FromPathinvoice & filenameinvoice, Destination:=ToPathinvoice
MsgBox "Succesfully done"
End If
rs.MoveNext
Next count
Exit Function
errorcatch:
MsgBox Err.Description
End Function
For eg., If '10765' file not exist - its ending the loop and code comes out.
I need it should search '10883' and continue till end '10966'