code help please (1 Viewer)

Dannyc989

Registered User.
Local time
Today, 03:03
Joined
Dec 18, 2013
Messages
46
I have an issue with the code below, i keep getting a syntax error on the red line anyone able to help??

Private Sub Command24_Click()
With CodeContextObject
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord
Beep
MsgBox "Order Successfully Updated and Progressed", vbOKOnly, ""
DoCmd.OpenQuery "Project Number Append Query", acViewNormal, acEdit
If (.MacroError <> 0) Then
Beep
MsgBox .MacroError.Description, vbOKOnly, ""
End If
End With

Dim LFolderpath As String
Dim LResponse As String
On Error GoTo NFolder
LFolderpath = CurrentProject.Path & "\NT Projects\" & [Project Number] & "_" & [Client] & "_" & [Description]
If Len(Dir("LFolderpath", vbDirectory)) = 0 Then
Application.FollowHyperlink LFolderpath
End If
NFolder:
LResponse = MsgBox("Folder doesn't exist for" & [Project Number] & "_" & [Client] & "_" & [Description] ". Would you like to create a new folder?", vbYesNo)
If LResponse = "6" Then
MkDir LFolderpath
Application.FollowHyperlink LFolderpath
Else
MsgBox ("No folder created and no folder exists")
End If

End Sub
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:03
Joined
Aug 30, 2003
Messages
36,127
Missing & between [Description] and the rest of the fixed text.
 

smig

Registered User.
Local time
Today, 05:03
Joined
Nov 25, 2009
Messages
2,209
+ you can add vbCrLf there to start a new line
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:03
Joined
Aug 30, 2003
Messages
36,127
Happy to help.
 

Users who are viewing this thread

Top Bottom