If File Exists then ......

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

He Group,

I would like to be able to Modify the follwoing code:

Private Sub btnCentrexLinesReports_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesReports.Click
rptForm.Text = "Excellence.Net - Centrex Lines Cab Report"
rptForm.CRVReportPrint.ReportSource = New CentrexLinesCabReport()
rptForm.CRVReportPrint.RefreshReport()
rptForm.ShowDialog()
End Sub

So that, If \\Data01\Ambercat Database\Excellence.Net\Network.txt exists it
runs and if it dosn`t exist it pops up a Message box saying Sorry You are
working offline, and reports carn`t be run.

Anybody suggest the best way to do this?

Cheers
MCN
 
Try this:
Dim FILE_NAME As String = "C:\LogFile.txt"
If Not File.Exists(FILE_NAME) Then
Exit Sub
Else

B
 
Cheers Brian,

That worked a treat

Cheers
MCN

BrianDH said:
Try this:
Dim FILE_NAME As String = "C:\LogFile.txt"
If Not File.Exists(FILE_NAME) Then
Exit Sub
Else

B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top