PC Review


Reply
Thread Tools Rate Thread

Create an export file using user generated title and export data t

 
 
efandango
Guest
Posts: n/a
 
      4th Oct 2008
The code below will export the recordset data to a know filename and known
path.

I want to be able to have the user create the filename using a message box,
and then have the code incorporate that filename, add a .kml extenstion to
the filename and then export the recordset output to it.

If at all possible, I would love to be able to use the standard windows file
system dialog boxes, which would allow for a filename and the ability to
change paths. If not, I would gladly settle for just the dynamic filename
naming and export.

these are the lines that contains the pre-exisitng filename:

Open "W:\Folder\Addresses.kml" For Output As #lngFN


Dim stAppName As String
stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
W:\Folder\Addresses.kml"
Call Shell(stAppName, 1)



here is my exisitng code
***********************
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
Dim strStartRun_No As String
Dim strEndRun_No As String
Dim FileTitle As String
' Dim strRun_No As String
Dim lngFN As Long


'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

strStartRun_No = InputBox("Enter the lower Run No")
strEndRun_No = InputBox("Enter the higher Run No")
FileTitle = InputBox("Enter the file title")

If Len(strStartRun_No) > 0 Then
Set db = CurrentDb()
Set qdf = db.QueryDefs("Generate_KML_Run_Titles")
qdf.Parameters("StartRun") = strStartRun_No
qdf.Parameters("EndRun") = strEndRun_No

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "<?xml version=""1.0"" encoding=""UTF-8""?>"
Print #lngFN, "<kml xmlns=""http://earth.google.com/kml/2.0"">"
Print #lngFN, "<Document>"
Print #lngFN, "<name>" & FileTitle & "</name>"

Print #lngFN, "<Folder>"
'Print #lngFN, "<name>Locations</name>"
Print #lngFN, "<open>1</open>"

Set rs = qdf.OpenRecordset(dbOpenSnapshot)
Do Until rs.EOF = True
'Print #lngFN, rs.Fields("KML_Address")
Dim strWork As String

strWork = rs.Fields("KML_Address")
strWork = Replace(strWork, "&", "and")
'strWork = Replace(strWork, "&", "&")
strWork = Replace(strWork, "'", "&apos;")
'strWork = Replace(strWork, "<", "<")
Print #lngFN, strWork

rs.MoveNext
Loop
rs.Close
'Output footer
Print #lngFN, "</Folder>"
Print #lngFN, "</Document>"
Print #lngFN, "</kml>"
Close #lngFN
End If

On Error GoTo Err_Google_Earth_Points_Click

Dim stAppName As String

stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
W:\Folder\Addresses.kml"

Call Shell(stAppName, 1)

Exit_Google_Earth_Points_Click:
Exit Sub

Err_Google_Earth_Points_Click:
MsgBox Err.Description
Resume Exit_Google_Earth_Points_Click
*****************************
 
Reply With Quote
 
 
 
 
Dale Fye
Guest
Posts: n/a
 
      5th Oct 2008
Bookmark this site in your internet browser: http://www.mvps.org/access/

They have a ton of code examples. In your case, what I think you are
looking for is in the API section, at:

http://www.mvps.org/access/api/api0001.htm

HTH
Dale


"efandango" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The code below will export the recordset data to a know filename and known
> path.
>
> I want to be able to have the user create the filename using a message
> box,
> and then have the code incorporate that filename, add a .kml extenstion to
> the filename and then export the recordset output to it.
>
> If at all possible, I would love to be able to use the standard windows
> file
> system dialog boxes, which would allow for a filename and the ability to
> change paths. If not, I would gladly settle for just the dynamic filename
> naming and export.
>
> these are the lines that contains the pre-exisitng filename:
>
> Open "W:\Folder\Addresses.kml" For Output As #lngFN
>
>
> Dim stAppName As String
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\Addresses.kml"
> Call Shell(stAppName, 1)
>
>
>
> here is my exisitng code
> ***********************
> Dim db As DAO.Database
> Dim qdf As DAO.QueryDef
> Dim rs As DAO.Recordset
> Dim strStartRun_No As String
> Dim strEndRun_No As String
> Dim FileTitle As String
> ' Dim strRun_No As String
> Dim lngFN As Long
>
>
> 'Create empty text file
> lngFN = FreeFile()
> Open "W:\Folder\Addresses.kml" For Output As #lngFN
>
> strStartRun_No = InputBox("Enter the lower Run No")
> strEndRun_No = InputBox("Enter the higher Run No")
> FileTitle = InputBox("Enter the file title")
>
> If Len(strStartRun_No) > 0 Then
> Set db = CurrentDb()
> Set qdf = db.QueryDefs("Generate_KML_Run_Titles")
> qdf.Parameters("StartRun") = strStartRun_No
> qdf.Parameters("EndRun") = strEndRun_No
>
> 'Output header
> 'NB: need to double quotes in literal strings
> Print #lngFN, "<?xml version=""1.0"" encoding=""UTF-8""?>"
> Print #lngFN, "<kml xmlns=""http://earth.google.com/kml/2.0"">"
> Print #lngFN, "<Document>"
> Print #lngFN, "<name>" & FileTitle & "</name>"
>
> Print #lngFN, "<Folder>"
> 'Print #lngFN, "<name>Locations</name>"
> Print #lngFN, "<open>1</open>"
>
> Set rs = qdf.OpenRecordset(dbOpenSnapshot)
> Do Until rs.EOF = True
> 'Print #lngFN, rs.Fields("KML_Address")
> Dim strWork As String
>
> strWork = rs.Fields("KML_Address")
> strWork = Replace(strWork, "&", "and")
> 'strWork = Replace(strWork, "&", "&")
> strWork = Replace(strWork, "'", "&apos;")
> 'strWork = Replace(strWork, "<", "<")
> Print #lngFN, strWork
>
> rs.MoveNext
> Loop
> rs.Close
> 'Output footer
> Print #lngFN, "</Folder>"
> Print #lngFN, "</Document>"
> Print #lngFN, "</kml>"
> Close #lngFN
> End If
>
> On Error GoTo Err_Google_Earth_Points_Click
>
> Dim stAppName As String
>
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\Addresses.kml"
>
> Call Shell(stAppName, 1)
>
> Exit_Google_Earth_Points_Click:
> Exit Sub
>
> Err_Google_Earth_Points_Click:
> MsgBox Err.Description
> Resume Exit_Google_Earth_Points_Click
> *****************************



 
Reply With Quote
 
 
 
 
efandango
Guest
Posts: n/a
 
      5th Oct 2008
Dale,

I just realised that this method will not work with what I want to do. My
code as it is, has the benefit of parsing the filename straight to the
application (Google Earth), so I think the best solution is to have a method
of having a simple Access 'Message Box' pop-up asking for the filename, and
then have that filename merge with the line:
stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\Addresses.kml"


do you know how I can get the string variable into this line?

"Dale Fye" wrote:

> Bookmark this site in your internet browser: http://www.mvps.org/access/
>
> They have a ton of code examples. In your case, what I think you are
> looking for is in the API section, at:
>
> http://www.mvps.org/access/api/api0001.htm
>
> HTH
> Dale
>
>
> "efandango" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The code below will export the recordset data to a know filename and known
> > path.
> >
> > I want to be able to have the user create the filename using a message
> > box,
> > and then have the code incorporate that filename, add a .kml extenstion to
> > the filename and then export the recordset output to it.
> >
> > If at all possible, I would love to be able to use the standard windows
> > file
> > system dialog boxes, which would allow for a filename and the ability to
> > change paths. If not, I would gladly settle for just the dynamic filename
> > naming and export.
> >
> > these are the lines that contains the pre-exisitng filename:
> >
> > Open "W:\Folder\Addresses.kml" For Output As #lngFN
> >
> >
> > Dim stAppName As String
> > stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> > W:\Folder\Addresses.kml"
> > Call Shell(stAppName, 1)
> >
> >
> >
> > here is my exisitng code
> > ***********************
> > Dim db As DAO.Database
> > Dim qdf As DAO.QueryDef
> > Dim rs As DAO.Recordset
> > Dim strStartRun_No As String
> > Dim strEndRun_No As String
> > Dim FileTitle As String
> > ' Dim strRun_No As String
> > Dim lngFN As Long
> >
> >
> > 'Create empty text file
> > lngFN = FreeFile()
> > Open "W:\Folder\Addresses.kml" For Output As #lngFN
> >
> > strStartRun_No = InputBox("Enter the lower Run No")
> > strEndRun_No = InputBox("Enter the higher Run No")
> > FileTitle = InputBox("Enter the file title")
> >
> > If Len(strStartRun_No) > 0 Then
> > Set db = CurrentDb()
> > Set qdf = db.QueryDefs("Generate_KML_Run_Titles")
> > qdf.Parameters("StartRun") = strStartRun_No
> > qdf.Parameters("EndRun") = strEndRun_No
> >
> > 'Output header
> > 'NB: need to double quotes in literal strings
> > Print #lngFN, "<?xml version=""1.0"" encoding=""UTF-8""?>"
> > Print #lngFN, "<kml xmlns=""http://earth.google.com/kml/2.0"">"
> > Print #lngFN, "<Document>"
> > Print #lngFN, "<name>" & FileTitle & "</name>"
> >
> > Print #lngFN, "<Folder>"
> > 'Print #lngFN, "<name>Locations</name>"
> > Print #lngFN, "<open>1</open>"
> >
> > Set rs = qdf.OpenRecordset(dbOpenSnapshot)
> > Do Until rs.EOF = True
> > 'Print #lngFN, rs.Fields("KML_Address")
> > Dim strWork As String
> >
> > strWork = rs.Fields("KML_Address")
> > strWork = Replace(strWork, "&", "and")
> > 'strWork = Replace(strWork, "&", "&")
> > strWork = Replace(strWork, "'", "&apos;")
> > 'strWork = Replace(strWork, "<", "<")
> > Print #lngFN, strWork
> >
> > rs.MoveNext
> > Loop
> > rs.Close
> > 'Output footer
> > Print #lngFN, "</Folder>"
> > Print #lngFN, "</Document>"
> > Print #lngFN, "</kml>"
> > Close #lngFN
> > End If
> >
> > On Error GoTo Err_Google_Earth_Points_Click
> >
> > Dim stAppName As String
> >
> > stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> > W:\Folder\Addresses.kml"
> >
> > Call Shell(stAppName, 1)
> >
> > Exit_Google_Earth_Points_Click:
> > Exit Sub
> >
> > Err_Google_Earth_Points_Click:
> > MsgBox Err.Description
> > Resume Exit_Google_Earth_Points_Click
> > *****************************

>
>
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      5th Oct 2008
Assuming you grab the code to which Dale pointed, you'd need something like:

Dim stAppName As String
Dim strFile As String
Dim strFilter As String

stAppName = """C:\Program Files\Google\Google Earth\GoogleEarth.exe"""

strFilter = ahtAddFilterItem(strFilter, "KML Files (*.KML)", "*.KML")
strFile= ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

If Len(strFile) > 0 Then
Call Shell(stAppName & " """ & strFile & """", 1)
End If


Note the extra double quotes there: they're to handle spaces in the file
path. There are three double quotes at the beginning and end of the
statement assigning the value to stAppName. In the call to the Shell
statement, there are three double quotes in front of strFile, and four
double quotes after it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"efandango" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dale,
>
> I just realised that this method will not work with what I want to do. My
> code as it is, has the benefit of parsing the filename straight to the
> application (Google Earth), so I think the best solution is to have a
> method
> of having a simple Access 'Message Box' pop-up asking for the filename,
> and
> then have that filename merge with the line:
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
>> W:\Folder\Addresses.kml"

>
> do you know how I can get the string variable into this line?
>
> "Dale Fye" wrote:
>
>> Bookmark this site in your internet browser: http://www.mvps.org/access/
>>
>> They have a ton of code examples. In your case, what I think you are
>> looking for is in the API section, at:
>>
>> http://www.mvps.org/access/api/api0001.htm
>>
>> HTH
>> Dale
>>
>>
>> "efandango" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > The code below will export the recordset data to a know filename and
>> > known
>> > path.
>> >
>> > I want to be able to have the user create the filename using a message
>> > box,
>> > and then have the code incorporate that filename, add a .kml extenstion
>> > to
>> > the filename and then export the recordset output to it.
>> >
>> > If at all possible, I would love to be able to use the standard windows
>> > file
>> > system dialog boxes, which would allow for a filename and the ability
>> > to
>> > change paths. If not, I would gladly settle for just the dynamic
>> > filename
>> > naming and export.
>> >
>> > these are the lines that contains the pre-exisitng filename:



 
Reply With Quote
 
efandango
Guest
Posts: n/a
 
      5th Oct 2008
Douglas,

Thanks for your timely input on this, and an answer for how to run the
filename with the App which I plan to use extensively for another similar
project.

But for now, with thisproject I want to continue with the simple 'message
box'. I have managed to incorporate the filename string from the message box
into the OPen file argument. But for some reason though the file is created
and is correct, it will not open into Google Earth; it's as if the file is
not closed before going into google earth; but when I run the old code which
uses a fixed/known filename, it opens perfectly in GE.

Here is the code that opens in GE:

Dim stAppName As String
stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
W:\Folder\Addresses.kml"
Call Shell(stAppName, 1)


Here is the code that doesn't open:

Dim stAppName As String

stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
W:\Folder\" & strFileName & ".kml"""

Call Shell(stAppName, 1)

"Douglas J. Steele" wrote:

> Assuming you grab the code to which Dale pointed, you'd need something like:
>
> Dim stAppName As String
> Dim strFile As String
> Dim strFilter As String
>
> stAppName = """C:\Program Files\Google\Google Earth\GoogleEarth.exe"""
>
> strFilter = ahtAddFilterItem(strFilter, "KML Files (*.KML)", "*.KML")
> strFile= ahtCommonFileOpenSave( _
> Filter:=strFilter, OpenFile:=True, _
> DialogTitle:="Please select an input file...", _
> Flags:=ahtOFN_HIDEREADONLY)
>
> If Len(strFile) > 0 Then
> Call Shell(stAppName & " """ & strFile & """", 1)
> End If
>
>
> Note the extra double quotes there: they're to handle spaces in the file
> path. There are three double quotes at the beginning and end of the
> statement assigning the value to stAppName. In the call to the Shell
> statement, there are three double quotes in front of strFile, and four
> double quotes after it.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "efandango" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Dale,
> >
> > I just realised that this method will not work with what I want to do. My
> > code as it is, has the benefit of parsing the filename straight to the
> > application (Google Earth), so I think the best solution is to have a
> > method
> > of having a simple Access 'Message Box' pop-up asking for the filename,
> > and
> > then have that filename merge with the line:
> > stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> >> W:\Folder\Addresses.kml"

> >
> > do you know how I can get the string variable into this line?
> >
> > "Dale Fye" wrote:
> >
> >> Bookmark this site in your internet browser: http://www.mvps.org/access/
> >>
> >> They have a ton of code examples. In your case, what I think you are
> >> looking for is in the API section, at:
> >>
> >> http://www.mvps.org/access/api/api0001.htm
> >>
> >> HTH
> >> Dale
> >>
> >>
> >> "efandango" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > The code below will export the recordset data to a know filename and
> >> > known
> >> > path.
> >> >
> >> > I want to be able to have the user create the filename using a message
> >> > box,
> >> > and then have the code incorporate that filename, add a .kml extenstion
> >> > to
> >> > the filename and then export the recordset output to it.
> >> >
> >> > If at all possible, I would love to be able to use the standard windows
> >> > file
> >> > system dialog boxes, which would allow for a filename and the ability
> >> > to
> >> > change paths. If not, I would gladly settle for just the dynamic
> >> > filename
> >> > naming and export.
> >> >
> >> > these are the lines that contains the pre-exisitng filename:

>
>
>

 
Reply With Quote
 
efandango
Guest
Posts: n/a
 
      5th Oct 2008
Douglas,

I have since solved the 'Message Box' method, with this:

Dim stAppName As String

stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
W:\Folder\" & strFileName & ".kml"

Call Shell(stAppName, 1)


Thank you, and Dale for your help.

"efandango" wrote:

> Douglas,
>
> Thanks for your timely input on this, and an answer for how to run the
> filename with the App which I plan to use extensively for another similar
> project.
>
> But for now, with thisproject I want to continue with the simple 'message
> box'. I have managed to incorporate the filename string from the message box
> into the OPen file argument. But for some reason though the file is created
> and is correct, it will not open into Google Earth; it's as if the file is
> not closed before going into google earth; but when I run the old code which
> uses a fixed/known filename, it opens perfectly in GE.
>
> Here is the code that opens in GE:
>
> Dim stAppName As String
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\Addresses.kml"
> Call Shell(stAppName, 1)
>
>
> Here is the code that doesn't open:
>
> Dim stAppName As String
>
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\" & strFileName & ".kml"""
>
> Call Shell(stAppName, 1)
>
> "Douglas J. Steele" wrote:
>
> > Assuming you grab the code to which Dale pointed, you'd need something like:
> >
> > Dim stAppName As String
> > Dim strFile As String
> > Dim strFilter As String
> >
> > stAppName = """C:\Program Files\Google\Google Earth\GoogleEarth.exe"""
> >
> > strFilter = ahtAddFilterItem(strFilter, "KML Files (*.KML)", "*.KML")
> > strFile= ahtCommonFileOpenSave( _
> > Filter:=strFilter, OpenFile:=True, _
> > DialogTitle:="Please select an input file...", _
> > Flags:=ahtOFN_HIDEREADONLY)
> >
> > If Len(strFile) > 0 Then
> > Call Shell(stAppName & " """ & strFile & """", 1)
> > End If
> >
> >
> > Note the extra double quotes there: they're to handle spaces in the file
> > path. There are three double quotes at the beginning and end of the
> > statement assigning the value to stAppName. In the call to the Shell
> > statement, there are three double quotes in front of strFile, and four
> > double quotes after it.
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no private e-mails, please)
> >
> >
> > "efandango" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Dale,
> > >
> > > I just realised that this method will not work with what I want to do. My
> > > code as it is, has the benefit of parsing the filename straight to the
> > > application (Google Earth), so I think the best solution is to have a
> > > method
> > > of having a simple Access 'Message Box' pop-up asking for the filename,
> > > and
> > > then have that filename merge with the line:
> > > stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> > >> W:\Folder\Addresses.kml"
> > >
> > > do you know how I can get the string variable into this line?
> > >
> > > "Dale Fye" wrote:
> > >
> > >> Bookmark this site in your internet browser: http://www.mvps.org/access/
> > >>
> > >> They have a ton of code examples. In your case, what I think you are
> > >> looking for is in the API section, at:
> > >>
> > >> http://www.mvps.org/access/api/api0001.htm
> > >>
> > >> HTH
> > >> Dale
> > >>
> > >>
> > >> "efandango" <(E-Mail Removed)> wrote in message
> > >> news:(E-Mail Removed)...
> > >> > The code below will export the recordset data to a know filename and
> > >> > known
> > >> > path.
> > >> >
> > >> > I want to be able to have the user create the filename using a message
> > >> > box,
> > >> > and then have the code incorporate that filename, add a .kml extenstion
> > >> > to
> > >> > the filename and then export the recordset output to it.
> > >> >
> > >> > If at all possible, I would love to be able to use the standard windows
> > >> > file
> > >> > system dialog boxes, which would allow for a filename and the ability
> > >> > to
> > >> > change paths. If not, I would gladly settle for just the dynamic
> > >> > filename
> > >> > naming and export.
> > >> >
> > >> > these are the lines that contains the pre-exisitng filename:

> >
> >
> >

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      5th Oct 2008
To be honest, I'm surprised that that works due to the presence of spaces in
the path.

I would think that you'd need

stAppName = """C:\Program Files\Google\Google Earth\GoogleEarth.exe"" " &
"W:\Folder\" & strFileName & ".kml"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"efandango" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Douglas,
>
> I have since solved the 'Message Box' method, with this:
>
> Dim stAppName As String
>
> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
> W:\Folder\" & strFileName & ".kml"
>
> Call Shell(stAppName, 1)
>
>
> Thank you, and Dale for your help.
>
> "efandango" wrote:
>
>> Douglas,
>>
>> Thanks for your timely input on this, and an answer for how to run the
>> filename with the App which I plan to use extensively for another similar
>> project.
>>
>> But for now, with thisproject I want to continue with the simple 'message
>> box'. I have managed to incorporate the filename string from the message
>> box
>> into the OPen file argument. But for some reason though the file is
>> created
>> and is correct, it will not open into Google Earth; it's as if the file
>> is
>> not closed before going into google earth; but when I run the old code
>> which
>> uses a fixed/known filename, it opens perfectly in GE.
>>
>> Here is the code that opens in GE:
>>
>> Dim stAppName As String
>> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
>> W:\Folder\Addresses.kml"
>> Call Shell(stAppName, 1)
>>
>>
>> Here is the code that doesn't open:
>>
>> Dim stAppName As String
>>
>> stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
>> W:\Folder\" & strFileName & ".kml"""
>>
>> Call Shell(stAppName, 1)
>>
>> "Douglas J. Steele" wrote:
>>
>> > Assuming you grab the code to which Dale pointed, you'd need something
>> > like:
>> >
>> > Dim stAppName As String
>> > Dim strFile As String
>> > Dim strFilter As String
>> >
>> > stAppName = """C:\Program Files\Google\Google
>> > Earth\GoogleEarth.exe"""
>> >
>> > strFilter = ahtAddFilterItem(strFilter, "KML Files (*.KML)", "*.KML")
>> > strFile= ahtCommonFileOpenSave( _
>> > Filter:=strFilter, OpenFile:=True, _
>> > DialogTitle:="Please select an input file...", _
>> > Flags:=ahtOFN_HIDEREADONLY)
>> >
>> > If Len(strFile) > 0 Then
>> > Call Shell(stAppName & " """ & strFile & """", 1)
>> > End If
>> >
>> >
>> > Note the extra double quotes there: they're to handle spaces in the
>> > file
>> > path. There are three double quotes at the beginning and end of the
>> > statement assigning the value to stAppName. In the call to the Shell
>> > statement, there are three double quotes in front of strFile, and four
>> > double quotes after it.
>> >
>> > --
>> > Doug Steele, Microsoft Access MVP
>> > http://I.Am/DougSteele
>> > (no private e-mails, please)
>> >
>> >
>> > "efandango" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> > > Dale,
>> > >
>> > > I just realised that this method will not work with what I want to
>> > > do. My
>> > > code as it is, has the benefit of parsing the filename straight to
>> > > the
>> > > application (Google Earth), so I think the best solution is to have a
>> > > method
>> > > of having a simple Access 'Message Box' pop-up asking for the
>> > > filename,
>> > > and
>> > > then have that filename merge with the line:
>> > > stAppName = "C:\Program Files\Google\Google Earth\GoogleEarth.exe
>> > >> W:\Folder\Addresses.kml"
>> > >
>> > > do you know how I can get the string variable into this line?
>> > >
>> > > "Dale Fye" wrote:
>> > >
>> > >> Bookmark this site in your internet browser:
>> > >> http://www.mvps.org/access/
>> > >>
>> > >> They have a ton of code examples. In your case, what I think you
>> > >> are
>> > >> looking for is in the API section, at:
>> > >>
>> > >> http://www.mvps.org/access/api/api0001.htm
>> > >>
>> > >> HTH
>> > >> Dale
>> > >>
>> > >>
>> > >> "efandango" <(E-Mail Removed)> wrote in message
>> > >> news:(E-Mail Removed)...
>> > >> > The code below will export the recordset data to a know filename
>> > >> > and
>> > >> > known
>> > >> > path.
>> > >> >
>> > >> > I want to be able to have the user create the filename using a
>> > >> > message
>> > >> > box,
>> > >> > and then have the code incorporate that filename, add a .kml
>> > >> > extenstion
>> > >> > to
>> > >> > the filename and then export the recordset output to it.
>> > >> >
>> > >> > If at all possible, I would love to be able to use the standard
>> > >> > windows
>> > >> > file
>> > >> > system dialog boxes, which would allow for a filename and the
>> > >> > ability
>> > >> > to
>> > >> > change paths. If not, I would gladly settle for just the dynamic
>> > >> > filename
>> > >> > naming and export.
>> > >> >
>> > >> > these are the lines that contains the pre-exisitng filename:
>> >
>> >
>> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create an export file using user generated title and export data t efandango Microsoft Access External Data 6 5th Oct 2008 02:50 PM
W2K Error: "SVCHOST has generated errors...An error log is being generated" ? Al Dykes Windows XP General 1 14th May 2005 03:54 PM
The application, C:\WINDOWS\system32\lsass.exe, generated an application error The error occurred on 05/03/2004 @ 10:50:46.755 The exception generated was c0000005 at address 00900090 () =?Utf-8?B?cmljayBj?= Windows XP General 2 5th May 2004 03:36 AM
a title, img title, fp-title =?Utf-8?B?QkIgSXZlcnNvbg==?= Microsoft Frontpage 1 13th Apr 2004 02:10 PM
I have windows XP Home, in windows explorer a folder with mp3s used to show a popup with title and Bitrate now it shows Type, Author, Title, Date Modified, and Size How can I get it back to Title and bitrate?? I use List, not Details jon@AZ.net Windows XP Help 3 30th Dec 2003 09:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:24 AM.