Code:
Private Sub Command64_Click()
Dim NPath As String
Dim CPath As String
Dim FPath As String
Dim PPath As String
Dim strReportName As String
If IsNull(Me.Order_Number) Then
If IsNull(Me.R_Number) Then
MsgBox "Please add an order number or R Number"
End
End If
End If
APath = "\\server\finance\Invoices\"
BPath = Me!Company_Name & ""
CPath = Me!Order_Number
Dpath = APath & BPath
EPath = Dpath & CPath & ""
strReportName = Me.Order_Number
Dim answer As Integer
answer = MsgBox("Are the PO details complete?", vbYesNo + vbQuestion)
If answer = vbNo Then
Exit Sub
Else
If Dir(Dpath, vbDirectory) = "" Then
MkDir (Dpath)
Else
'do nothing for the "C:\Text Files" directory already exists
'MsgBox FPath
End If
If Dir(EPath, vbDirectory) = "" Then
MkDir (EPath)
Else
'do nothing for the "C:\Text Files" directory already exists
'MsgBox FPath
End If
End If
End Sub
still reaching here:
Code:
CPath = Me!Order_Number
I believe both exit and end was working. It's the way I've written it.
Ill explain what I would like rather than what I thinks wrong. If order number is null then it should never reach the line :
then if R number is also null then the message box should trigger. but in any case order number is null it should not continue.