Hi Terence,
This sample should do what you want...
Create a form with two text boxes (Text1 and Text2) plus
a button (Command1) - I put a lot of thought into those names :>} Type a filename into Text1 and click the button.
NOTE: the code assumes a DOT between the prefix and suffix in the filename.
The code is tested and works.
Put this code on the button click event
=====================================
Private Sub Command1_Click()
If Not IsNull(Text1.Text) Then
Text2 = AddDateToFileName(Text1.Text)
End If
End Sub
Function AddDateToFileName(FileNameIn As String) As String
Dim intPos As Integer
intPos = InStr(FileNameIn, "."
AddDateToFileName = Left(FileNameIn, intPos - 1) & "_" & _
Left(Date, 2) & "_" & _
Mid(Date, 4, 2) & "_" & _
Mid(Date, 7) & _
Mid(FileNameIn, intPos)
End Function
=====================================
HTH