Browsefolder Dialog problem

  • Thread starter Peter McCartney
  • Start date
P

Peter McCartney

Hello! Thanking anyone for a reply. A97.

Re the browsefolder dialog section in the API on the access web, one section
is giving me problems. This section of the coding states:

strFolderName = BrowseFolder("What Folder you want to select?")

I wrote

strFolderName = BrowseFolder("c:\training")

but i get a compile error at this point, any suggestions.

Peter McCartney
 
C

Cheryl Fischer

Peter,

When you copied the code from the webpage into a Module, did you possibly
put the following two lines in the module, immediately followed by the Type
declarations? In other words, does the top of the module look like the
following:

Dim strFolderName as string
strFolderName = BrowseFolder("What Folder you want to select?")

'************** Code Start **************
'This code was originally written by Terry Kreft.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code courtesy of
'Terry Kreft

Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String

' END example

That is the only way that I could reproduce a problem and get a compile
error.

If this is your situation, remove the following two lines from your Module:

Dim strFolderName as string
strFolderName = BrowseFolder("What Folder you want to select?")

and put them in the Click event of a command button on a form.

hth,
 
P

Peter McCartney

That did the trick, thank you!!

Peter

Cheryl Fischer said:
Peter,

When you copied the code from the webpage into a Module, did you possibly
put the following two lines in the module, immediately followed by the Type
declarations? In other words, does the top of the module look like the
following:

Dim strFolderName as string
strFolderName = BrowseFolder("What Folder you want to select?")

'************** Code Start **************
'This code was originally written by Terry Kreft.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code courtesy of
'Terry Kreft

Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String

' END example

That is the only way that I could reproduce a problem and get a compile
error.

If this is your situation, remove the following two lines from your Module:

Dim strFolderName as string
strFolderName = BrowseFolder("What Folder you want to select?")

and put them in the Click event of a command button on a form.

hth,
 

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

Top