Quote:
> -----------------
> Dim SourceFile, DestinationFile '<--DECLARING VARIABLES FOR FILECOPY
You should declare these as strings not variants.
Where do you declare gstrFileName? (You'll lose marks if it's declared
globally)
Quote:
> 'USING COMMON DIALOG FOR FILENAME ENTRY
> dlgCommon.Filter = "Access Database Files (*.mdb)|*.mdb|All Files
(*.*)|*.*"
> dlgCommon.DialogTitle = "File New Database"
> dlgCommon.ShowSave 'displays the Save dialog box.
> 'Verifies a filename has been entered.
> If dlgCommon.FileName = "" Then
> Exit Sub
> Else
Poor structure. If you exit the sub there's no point in using the Else (just
use an End If). But better is to do the work if you have a valid filename:
If len(dlg.FileName) > 0 then
:
End if
Quote:
> 'Create the new filename 'CREATES THE NEW FILE IN THE SPECIFIED DIR.
> gstrFileName = dlgCommon.FileName
> Open gstrFileName For Output As #1
> Write #1, gstrFileName
> Close #1
This is pointless. You're creating a text file and writing the name of the
file into it.
Quote:
> End If
> 'FileCopy the carminder template to the new database file.
> SourceFile = App.Path & "\carminder_template.mdp"
> DestinationFile = gstrFileName
Why introduce a new variable? What's wrong with gstrFileName.
Quote:
> FileCopy SourceFile, DestinationFile '<--THIS IS WHERE IT BREAKS FOR ME.
> -----------------
> As I mentioned, the code breaks at the "FileCopy SourceFile,
> DestinationFile" line. The error message is "File Not Found."
> I checked the values of SourceFile & DestinationFile by displaying
msgboxes.
> The values are:
> SourceFile = C:\My Documents\vb project\template.mdb
What happened to carminder_template.mdb ?
Quote:
> DestinationFile = C:\My Documents\vb project\newfile.mdb
> For the life of me I can't figure out what I'm doing wrong here. If
anyone
> has any serious suggestions, please help me out. No sarcastic posts
please.
> Jedispy