S
Simon
I am trying to copy an excel .xlt file and create a .xls file from the
OnClick event of a Command button using vba.
If I use a fixed path for the .xls this is fine. However, I would like to
automatically default to the Clients individual file and allow the user to
give it a name. I have an unbound textbox (Text12) on my form which has its
data set to DLookup... for the path and a second unbound textbox (Text4) for
the user to type a name. I have changed the code a thousand times but can't
get it right. Can anyone help?
The latest attempt is this,
Dim xl As Object
Dim SourceFile As String
Dim ClientFile As String
Dim DestinationFile As String
SourceFile = "D:\Documents and Settings\Simon\Desktop\ValSumTemp.xlt"
ClientFile = [Text12]
DestinationFile = ClientFile & Me![Text4] & Me![Text10]
FileCopy SourceFile, DestinationFile
I am using Access and Excel 2003 and any help would be gratefully received.
OnClick event of a Command button using vba.
If I use a fixed path for the .xls this is fine. However, I would like to
automatically default to the Clients individual file and allow the user to
give it a name. I have an unbound textbox (Text12) on my form which has its
data set to DLookup... for the path and a second unbound textbox (Text4) for
the user to type a name. I have changed the code a thousand times but can't
get it right. Can anyone help?
The latest attempt is this,
Dim xl As Object
Dim SourceFile As String
Dim ClientFile As String
Dim DestinationFile As String
SourceFile = "D:\Documents and Settings\Simon\Desktop\ValSumTemp.xlt"
ClientFile = [Text12]
DestinationFile = ClientFile & Me![Text4] & Me![Text10]
FileCopy SourceFile, DestinationFile
I am using Access and Excel 2003 and any help would be gratefully received.