Hello.
Somethink that seam so simple in my head is turning out to be a pain in the butt.
I have the inputbox so i can set a string value,
When the inputbox Cancle button is pressed i want to exit sub,
If the inputbox value is nothink and ok button, I want the msgbox displayed then goto newname.
If the inputbox has a value do >>>>>>That>>>>>
Private Sub CommandButton6_Click() 'Upload File
Dim strName As String
Dim imgfolder As String
'get the path to the images
imgfolder = ThisWorkbook.Path & Application.PathSeparator & _
"Images" & Application.PathSeparator
'load picture to form
' Chane file name
If Label1.Caption = "" Or Label1.Caption = vbNewLine & " " & _
"Upload Files From Computer..." Then Exit Sub Else
NewName:
strName = InputBox(Prompt:=Label1.Caption & vbNewLine & vbNewLine _
& vbNewLine & vbNewLine & "Rename File Before Database Entry???", _
Title:="Attachment File Name", Default:="Your Name here"): Rem change for filename
If vbCancel Then Exit Sub
If strName = "" Then msgbox "A Name Must Be Entered", vbOKOnly
If vbOKOnly And strName = "" Then GoTo NewName
If strName <> "" Then FileCopy Label1.Caption, imgfolder & strName & ".jpg"
ListBox1.AddItem strName
Label1.Caption = vbNewLine & " " & _
"Upload Files From Computer..."
CommandButton6.Font.Bold = False
Thankyou.
Bookmarks